Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Two percent of zero is almost nothing.


devel / comp.lang.python / Re: Subpixel positioning on Tk canvas

SubjectAuthor
* Re: Subpixel positioning on Tk canvasChristian Gollwitzer
`* Re: Subpixel positioning on Tk canvasTerry Reedy
 `- Re: Subpixel positioning on Tk canvasChristian Gollwitzer

1
Re: Subpixel positioning on Tk canvas

<sajsj6$2ff$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18190&group=comp.lang.python#18190

  copy link   Newsgroups: comp.lang.tcl comp.lang.python
Followup: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl,comp.lang.python
Subject: Re: Subpixel positioning on Tk canvas
Followup-To: comp.lang.python
Date: Sat, 19 Jun 2021 06:42:14 +0200
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <sajsj6$2ff$1@dont-email.me>
References: <48f323d8-b754-48ba-88ed-2eade6d8e230n@googlegroups.com>
<sajre4$gp1$1@dont-email.me>
<87c1107c-7577-4d4a-8962-e087b0d79f04n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 19 Jun 2021 04:42:15 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b9378d5ba71b647b00482edb58a2d34d";
logging-data="2543"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VCgsSFqpbBBI7h+gO1Wm5SfwBnpe+Fus="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.11.0
Cancel-Lock: sha1:BoAzSeAGUDp+Cel3T0QJL3//Dhs=
In-Reply-To: <87c1107c-7577-4d4a-8962-e087b0d79f04n@googlegroups.com>
 by: Christian Gollwitzer - Sat, 19 Jun 2021 04:42 UTC

Am 19.06.21 um 06:26 schrieb George Furbish:
> On Saturday, June 19, 2021 at 12:22:31 AM UTC-4, Christian Gollwitzer wrote:
>> Am 19.06.21 um 02:03 schrieb George Furbish:
>>> Does Tk support interpolation/subpixel positioning of canvas elements? (e.g. images, text.) I have moving elements on my canvas, but the movement isn't very smooth and it's especially obvious when I have text moving alongside an image, since the two elements tend to jump to the next pixel at different times, creating a little judder between the two.
>> There is an "improved canvas" available, tkpath, which supports
>> antialiasing on all platforms. It is part of, e.g. undroidwish, if you
>> want to experiment with it. Last time I tested it had problems on macOS
>> though.
>
> How can I enable or access the improved canvas via Tkinter?
>

Probably by writing the wrapper for it ;)

Sorry for that answer, but Tkinter does not support many of the most
useful extensions for Tcl/Tk, because someone has to write the wrappers.
It only supports what is provided by base Tk. Among those I consider
useful and use in almost any application are:

* TkDnD for native drag'n'drop support (there is an inferior python
package of the same name which implements local DnD only)

* tablelist - complete widget for displaying trees and tables like
ttk::treeview, but with almost every feature one could imagine

* pdf4tcl - create a PDF from a canvas content, e.g. for printing
.....

Basically you call Tcl via the eval() method of tkinter; in principle
you could do

========================
import tkinter as tk
root=tk()

root.eval('package require tkpath')
root.eval('...here comes your tkpath code...')
root.call('.tkp', 'create', 'oval', ....)
============================

tkpath is described here: https://wiki.tcl-lang.org/page/tkpath

For the wrapping, look at the implementation files of Tkinter, for say,
the original canvas, and modify accordingly.

Christian

Re: Subpixel positioning on Tk canvas

<mailman.132.1624158814.4164.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18218&group=comp.lang.python#18218

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: tjreedy@udel.edu (Terry Reedy)
Newsgroups: comp.lang.python
Subject: Re: Subpixel positioning on Tk canvas
Date: Sat, 19 Jun 2021 19:49:47 -0400
Lines: 74
Message-ID: <mailman.132.1624158814.4164.python-list@python.org>
References: <48f323d8-b754-48ba-88ed-2eade6d8e230n@googlegroups.com>
<sajre4$gp1$1@dont-email.me>
<87c1107c-7577-4d4a-8962-e087b0d79f04n@googlegroups.com>
<sajsj6$2ff$1@dont-email.me> <salvr5$137h$1@ciao.gmane.io>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de YvlO+AzJfJaTXg10h44fwAOqxL+olzfLrV7v90Yx82hQ==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.006
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(e.g.': 0.04; 'tkinter':
0.05; 'e.g.': 0.07; 'linux': 0.07; 'images,': 0.09; 'macos': 0.09;
'message-id:@ciao.gmane.io': 0.09; 'received:ciao.gmane.io': 0.09;
'received:gmane.io': 0.09; 'received:list': 0.09; 'schrieb': 0.09;
'terry': 0.09; 'though.': 0.09; 'import': 0.14; '8bit%:47': 0.16;
'>>>>': 0.16; 'extensions': 0.16; 'from:addr:udel.edu': 0.16;
'gollwitzer': 0.16; 'image,': 0.16; 'implements': 0.16;
'received:116.202': 0.16; 'received:116.202.254': 0.16;
'received:116.202.254.214': 0.16; 'times,': 0.16; 'widget': 0.16;
'wrapper': 0.16; 'wrote:': 0.16; 'python': 0.16; 'modify': 0.20;
'basically': 0.23; 'to:addr:python-list': 0.23; 'url:wiki': 0.24;
'probably': 0.24; '>>>': 0.26; 'available,': 0.27; 'elements':
0.27; 'creating': 0.27; "isn't": 0.29; 'local': 0.29; 'text':
0.29; 'header:User-Agent:1': 0.31; 'there': 0.31; 'but': 0.31;
'am,': 0.31; 'christian': 0.32; 'printing': 0.33; 'header:In-
Reply-To:1': 0.33; 'files': 0.33; 'same': 0.34; 'url:page': 0.35;
'pdf': 0.37; 'two': 0.37; 'those': 0.38; "it's": 0.38; 'use':
0.38; 'does': 0.38; 'someone': 0.39; 'comes': 0.40; 'otherwise':
0.40; 'package': 0.40; 'require': 0.40; 'could': 0.40; 'complete':
0.61; 'among': 0.61; 'sorry': 0.61; 'skip:\xc2 10': 0.62; 'your':
0.64; 'look': 0.66; 'june': 0.66; 'george': 0.68; 'content,':
0.69; 'obvious': 0.69; 'received:116': 0.71; 'little': 0.75;
'accordingly.': 0.77; '....': 0.81; '2021': 0.84; 'alongside':
0.84; 'experiment': 0.84; 'only)': 0.84; 'platforms.': 0.84;
'positioning': 0.84; 'saturday,': 0.84; 'say,': 0.84; 'tables':
0.84; 'tend': 0.91
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
In-Reply-To: <sajsj6$2ff$1@dont-email.me>
Content-Language: en-US
X-Mailman-Approved-At: Sat, 19 Jun 2021 23:13:33 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <salvr5$137h$1@ciao.gmane.io>
X-Mailman-Original-References: <48f323d8-b754-48ba-88ed-2eade6d8e230n@googlegroups.com>
<sajre4$gp1$1@dont-email.me>
<87c1107c-7577-4d4a-8962-e087b0d79f04n@googlegroups.com>
<sajsj6$2ff$1@dont-email.me>
 by: Terry Reedy - Sat, 19 Jun 2021 23:49 UTC

On 6/19/2021 12:42 AM, Christian Gollwitzer wrote:
> Am 19.06.21 um 06:26 schrieb George Furbish:
>> On Saturday, June 19, 2021 at 12:22:31 AM UTC-4, Christian Gollwitzer
>> wrote:
>>> Am 19.06.21 um 02:03 schrieb George Furbish:
>>>> Does Tk support interpolation/subpixel positioning of canvas
>>>> elements? (e.g. images, text.) I have moving elements on my canvas,
>>>> but the movement isn't very smooth and it's especially obvious when
>>>> I have text moving alongside an image, since the two elements tend
>>>> to jump to the next pixel at different times, creating a little
>>>> judder between the two.
>>> There is an "improved canvas" available, tkpath, which supports
>>> antialiasing on all platforms. It is part of, e.g. undroidwish, if you
>>> want to experiment with it. Last time I tested it had problems on macOS
>>> though.
>>
>> How can I enable or access the improved canvas via Tkinter?
>>
>
> Probably by writing the wrapper for it ;)
>
> Sorry for that answer, but Tkinter does not support many of the most
> useful extensions for Tcl/Tk, because someone has to write the wrappers.
> It only supports what is provided by base Tk. Among those I consider
> useful and use in almost any application are:

Are these extensions included with the tcl/tk distribution, or otherwise
available from active state? Are this extensions included with Linux
installations of tcl/tk? Or easily installed?

> * TkDnD for native drag'n'drop support (there is an inferior python
> package of the same name which implements local DnD only)
>
> * tablelist - complete widget for displaying trees and tables like
> ttk::treeview, but with almost every feature one could imagine
>
> * pdf4tcl - create a PDF from a canvas content, e.g. for printing
> ....
>
> Basically you call Tcl via the eval() method of tkinter; in principle
> you could do
>
> =======================> import tkinter as tk
> root=tk()
>
> root.eval('package require tkpath')
> root.eval('...here comes your tkpath code...')
> root.call('.tkp', 'create', 'oval', ....)
> ===========================>
> tkpath is described here: https://wiki.tcl-lang.org/page/tkpath
>
> For the wrapping, look at the implementation files of Tkinter, for say,
> the original canvas, and modify accordingly.
>
>     Christian
>

--
Terry Jan Reedy

Re: Subpixel positioning on Tk canvas

<sar0r8$l8a$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=18275&group=comp.lang.python#18275

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.python
Subject: Re: Subpixel positioning on Tk canvas
Date: Mon, 21 Jun 2021 23:37:42 +0200
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <sar0r8$l8a$1@dont-email.me>
References: <48f323d8-b754-48ba-88ed-2eade6d8e230n@googlegroups.com>
<sajre4$gp1$1@dont-email.me>
<87c1107c-7577-4d4a-8962-e087b0d79f04n@googlegroups.com>
<sajsj6$2ff$1@dont-email.me> <salvr5$137h$1@ciao.gmane.io>
<mailman.132.1624158814.4164.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 21 Jun 2021 21:37:44 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="de43cf1f887d594068249eecd3bfc474";
logging-data="21770"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/2hIx18h4TtNDOs5Opsz2pHjO9aDwMu60="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.11.0
Cancel-Lock: sha1:/bOOPt7ynoSGWR9FLHD0/CXjFVY=
In-Reply-To: <mailman.132.1624158814.4164.python-list@python.org>
 by: Christian Gollwitzer - Mon, 21 Jun 2021 21:37 UTC

Am 20.06.21 um 01:49 schrieb Terry Reedy:
> On 6/19/2021 12:42 AM, Christian Gollwitzer wrote:
>> Sorry for that answer, but Tkinter does not support many of the most
>> useful extensions for Tcl/Tk, because someone has to write the
>> wrappers. It only supports what is provided by base Tk. Among those I
>> consider useful and use in almost any application are:
>
> Are these extensions included with the tcl/tk distribution, or otherwise
> available from active state?  Are this extensions included with Linux
> installations of tcl/tk?  Or easily installed?

Since ActiveState has pulled out the developers of Tcl a few years ago,
I haven't used ActiveTcl anymore. I was surprised to see that they
actually offer a fairly recent version, but it also cannot be simply
downloaded, one has to register. It was unclear to me if it costs money.

Other people have stepped in to provide Tcl distributions where tese
extensions are included; notable exanples are BAWT by Paul Obermeier
http://www.bawt.tcl3d.org/download.html which offers all of the
mentioned packages (and many more), Androwish/Undroidwish by Christian
Werner which was originally developed for Android, but now works on te
major desktop platforms, http://androwish.org/home/wiki?name=undroidwish
and even kbskit can be mentioned, started by Rene Zaumseil and now
updated in irregular intervals by me https://github.com/auriocus/kbskit

I haven't checked the major linux distros, but they also might ship with
some of these extensions.

Concerning installation, it differs. Tablelist (also part of tklib) and
pdf4tcl are pure-Tcl packages and therefore easily installed.
TkDnD, TkTable and tkTreeCtrl are compiled extensions and therefore more
difficult - however, due to the stubs mechanism of Tcl, the version
number of Tcl and C compiler do NOT need to match. Typically a binary
downloaded for the right OS and bitness will work, and compilation from
source works with an autoconf-based configure script.

Due to ActiveState's failure with the teapot, the Tcl world does now not
any longer have a central repository tool like "pip" which works for
everyone. This has just recently been discussed on comp.lang.tcl, but it
is unlikely to happen in the near future.

It is of course unrealistic to expect that Tkinter supports every odd Tk
extension fron the Tcl world, which might not even be maintained any
longer. OTOH there are extensions that are well-maintained, that could
as well be part of the core Tk, but aren't for political reasons. If
Tkinter continues to be the shipped "first choice" GUI for Python, then
a few could be included - or otherwise Tkinter will lack Drag'n'drop for
ever and a reasonable Tree widget (the core one is verrrry basic).

Best regards,

Christian


devel / comp.lang.python / Re: Subpixel positioning on Tk canvas

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor