Re: Subpixel positioning on Tk canvas
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 vey basic). Best regards, Christian -- https://mail.python.org/mailman/listinfo/python-list
Re: Subpixel positioning on Tk canvas
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 -- https://mail.python.org/mailman/listinfo/python-list
Re: Subpixel positioning on Tk canvas
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 -- https://mail.python.org/mailman/listinfo/python-list