Size: 4317
Comment:
|
Size: 2770
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
["Tcl"]/["Tk"] developers have constructed many interesting | [[Tcl]]/[[Tk]] developers have constructed many interesting |
Line 3: | Line 3: |
these--["Tix"], for example--are reasonably well known and | these--[[Tix]], for example--are reasonably well known and |
Line 5: | Line 5: |
["TkInter"] programmer sees a promising Tk extension, is it | [[TkInter]] programmer sees a promising Tk extension, is it |
Line 11: | Line 11: |
sets, most notably including ["BWidgets"] and ["tklib"], are | sets, most notably including [[BWidgets]] and [[tklib]], are |
Line 13: | Line 13: |
them in at run time, with no need for (re-)compilation, | them in at run time, with no need for (re-)compilation, |
Line 16: | Line 16: |
These extensions are nearly as easy for ["TkInter"] programmers to use. Here's an example: |
These extensions are nearly as easy for [[TkInter]] programmers to use. Here's an example: |
Line 33: | Line 33: |
On the other hand, ["Tix"] and ["BLT"] are popular Tk extensions which | On the other hand, [[Tix]] and [[BLT]] are popular Tk extensions which |
Line 43: | Line 43: |
library that loads the ["Tix"] extension. | library that loads the [[Tix]] extension. |
Line 46: | Line 46: |
Tcl in ["TkInter"] will find it. The best place to try is as a subdirectory | Tcl in [[TkInter]] will find it. The best place to try is as a subdirectory |
Line 60: | Line 60: |
https://effbot.org/zone/bwidgets.htm | https://effbot.org/zone/bwidgets.htm |
Line 66: | Line 66: |
[https://wiki.tcl.tk/tkinter Tkinter]. == This problem is described there so so ... == [https://hotlesbians.synnt.com/ | free 1esbian vids][https://hotlesbians.synnt.com/free-1esbian-action.html | free 1esbian action][https://hotlesbians.synnt.com/free-1esbian-downloads.html | free 1esbian downloads][https://hotlesbians.synnt.com/ebony-1esbian-p0Rn.html | ebony 1esbian p0Rn][https://hotlesbians.synnt.com/1esbian-s3x-video.html | 1esbian s3x video][https://hotlesbians.synnt.com/1esbian-movie-galleries.html | 1esbian movie galleries][https://hotlesbians.synnt.com/free-1esbian-xyx.html | free 1esbian xyx][https://hotlesbians.synnt.com/teen-1esbian-p0Rn.html | teen 1esbian p0Rn][https://hotlesbians.synnt.com/1esbian-bondage-stories.html | 1esbian bondage stories][https://hotlesbians.synnt.com/quality-daily-1esbian-pics.html | quality daily 1esbian pics][https://hotlesbians.synnt.com/free-hardcore-1esbians.html | free hardcore 1esbians][https://hotlesbians.synnt.com/teen-1esbian-s3x-pictures.html | teen 1esbian s3x pictures][https://hotlesbians.synnt.com/1esbian-1ncest-stories.html | 1esbian 1ncest stories][https://hotlesbians.synnt.com/download-free-1esbian-video-clip.html | download free 1esbian video clip][https://hotlesbians.synnt.com/1esbian-bedtime-stories.html | 1esbian bedtime stories][https://hotlesbians.synnt.com/1esbian-s3x-positions.html | 1esbian s3x positions][https://hotlesbians.synnt.com/pussy-1esbian.html | pussy 1esbian][https://hotlesbians.synnt.com/1esbian-pics-free.html | 1esbian pics free][https://hotlesbians.synnt.com/hot-1esbian-pics.html | hot 1esbian pics] |
[[https://wiki.tcl.tk/tkinter|Tkinter]]. |
Tcl/Tk developers have constructed many interesting widget sets which extend Tk's basic functionality. A few of these--Tix, for example--are reasonably well known and accessible to Tkinter users. What about the rest? When a TkInter programmer sees a promising Tk extension, is it likely to do him or her any good?
Briefly, yes. First, it's important to make the distinction between so-called "pure Tk" extensions and those that involve (external) C-coded compilation. Quite a few useful widgets sets, most notably including BWidgets and tklib, are "pure Tk". That means that Tcl/Tk programmers simply read them in at run time, with no need for (re-)compilation, configuration, or other deployment complexities.
These extensions are nearly as easy for TkInter programmers to use. Here's an example:
If you have a file of Tcl code in a file called foo.tcl and you want to call the Tcl function foo_bar then
import Tkinter root = Tkinter.Tk() root.tk.eval('source {foo.tcl}') root.tk.eval('foo_bar')
will load and execute foo_bar. To see the details of passing and returing arguments, Use the Source Luke, and look at Lib/lib-tk/Tkinter.py. For wrappers of other popular Tk widgets, look at the Python/ directory of the Tixapps distribution https://tix.sourceforge.net/Tixapps/
On the other hand, Tix and BLT are popular Tk extensions which require compilation. These days (since version 8.0 of Tk) most extensions are compiled as dynamic loading packages, and are as easy to load into Tkinter as pure Tk extensions using a Python expression like
root.tk.eval('package require Ext')
For an example of this, see the Lib/lib-tk/Tix.py file in the standard library that loads the Tix extension.
The trick here is to install the extension library directory in a place the Tcl in TkInter will find it. The best place to try is as a subdirectory of Tcl/ in the Python installation. If this does not work, look into the file pkgIndex.tcl in the extension's library directory and try to understand what it is doing to load the .dll or .so shared library. To ask Tcl to consider a specific directory that contains a package, use
root.tk.eval('lappend auto_path {%s}' % the_tcl_directory)
FredrikLundh has pages which he calls "work in progress", but which readers are certain to find helpful: https://effbot.org/zone/bwidgets.htm and https://effbot.org/zone/tkinter-text-bind-insert-delete.htm The latter explicitly extends Tkinter through use of Tcl. Also, Gustavo Cordero is working in this same area; his work is likely to show up in the Tcl-ers' Wiki for Tkinter.