Tcl style traces

John Roth newsgroups at jhrothjr.com
Wed Jan 28 10:18:22 EST 2004


"Derek Fountain" <nomail at hursley.ibm.com> wrote in message
news:40177f07$0$1730$5a62ac22 at freenews.iinet.net.au...
> > What do you need this for?  If you can be more specific, we might be
able
> > to help you a little better.
>
> I have a Tcl/Tk script which uses a canvas to graphically represent the
data
> stored in the program. Whenever the data store is updated, a Tcl trace
> automatically triggers to ensure the graphical display is kept consistent
> with the data. I was after a simple way to convert the script to Python
> Tkinter. Without the eqivalent of Tcl traces I'm probably going to have to
> think about it... ;o)

There's a facility where you can associate a widget with a
variable so that when the variable changes the widget's
value changes, and vice versa. I don't offhand remember the
details though. You'll need to look at one of the references.
The variable has to be a subclass of a special Tkinter class
for this to work, though.

John Roth





More information about the Python-list mailing list