Tkinter - Reading widgets during a callback

Scott David Daniels Scott.Daniels at Acm.Org
Mon Dec 9 16:10:48 EST 2002


Andrew wrote:
> Hi,
> I have two buttons, "Start Processing" and "Abort".  When the user 
 > hits "Start Processing", the callback for this button runs...
The trick is to simply _start_ the processing with the "Start" button.
Have a thread listen to a queue for "Start Processing" messages, and
run computations whenever it gets such a message.
The "Start..." button puts that message on the queue.
The "Abort" button sets a "stop early" flag, that the computation
periodically examines.
For extra credit, decide exactly when this flag gets set and cleared.

-Scott David Daniels




More information about the Python-list mailing list