Tcl style traces

Cameron Laird claird at lairds.com
Wed Jan 28 08:13:58 EST 2004


In article <40177f07$0$1730$5a62ac22 at freenews.iinet.net.au>,
Derek Fountain  <nomail at hursley.ibm.com> wrote:
>> 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)

Newsgroups: comp.lang.python
Subject: Re: Tcl style traces
Summary: 
Expires: 
References: <40171be5$0$1742$5a62ac22 at freenews.iinet.net.au> <mailman.890.1075270902.12720.python-list at python.org> <40177f07$0$1730$5a62ac22 at freenews.iinet.net.au>
Sender: 
Followup-To: 
Reply-To: claird at phaseit.net
Distribution: 
Organization: The Lairds
Keywords: 
Cc: 

In article <40177f07$0$1730$5a62ac22 at freenews.iinet.net.au>,
Derek Fountain  <nomail at hursley.ibm.com> wrote:
>> 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)

The Pythonic thing to do is to intercept the data store's set or 
__setattr__ or ... method.
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list