Embedding in Tkinter (reprise)

Pier Paolo Glave pierpaolo.glave at ciaolab.com
Tue Jun 25 09:04:59 EDT 2002


I tried to follow the hint by Jeff, but it seems that the TkSteal
package hasn't been updated for a long time: the last available
version is for Tk 4.x.

Anyway, I made some further investigation on Tcl/Tk, and I found out
that there exists an extension package to Tk 8.x, named BLT, which has
a "container" object that can fit for my needs.

I tried this Tcl code sample, and I succeeded in embedding an "xclock"
into a Tk window:


#!/usr/bin/bltwish
package require BLT
if { $tcl_version >= 8.0 } {
    namespace import blt::*
    namespace import -force blt::tile::*
}
frame .f 
bgexec myVar xclock &
container .f.c
pack .f -fill both -expand yes
pack .f.c -fill both -expand yes -padx .1i -pady .1i
.f.c configure -relief raised -bd 2 -name "xclock"


Now, my problem is that I'm not an expert in Python/Tk integration,
and I don't know how to wrap this into a Python class.

Does anyone have any suggestions?

Thank you and regards,
--
Pier Paolo Glave

Jeff Epler <jepler at unpythonic.net> wrote in message news:<mailman.1024936355.12699.python-list at python.org>...
> Search for the "tksteal" package.  This adds a Tk widget that can
> "swallow" or "steal" an arbitrary window when its window ID is given.
> Once you've compiled this and it is available to your Tcl/Tk
> installation, you need merely define a Python class that wraps this new
> widget type, like the existing ones in Tkinter.py.
> 
> I found a manpage here:
> http://www-komo.ise.eng.osaka-u.ac.jp/misc/tcl/tk_steal_man/tksteal.n.html
> One copy of the source code for this widget seems to be at
> ftp://ftp.neosoft.com/languages/tcl/sorted/packages-7.6/devel/TkSteal4.0c.tar.gz
> but there are a lot of dead links related to this piece of software.
> 
> Jeff



More information about the Python-list mailing list