Tkinter - Reading widgets during a callback

Andrew andrewnewsgroup at hotmail.com
Mon Dec 9 15:55:14 EST 2002


Hi,
Here is my Tkinter GUI problem.  I have two buttons, "Start
Processing" and "
Abort".  When the user hits "Start Processing", the callback for this
button runs - it performs some computational heavy processing that
goes on for minutes.  Sometimes the user may want to abort this
processing, so they would like to hit the "Abort" button and have the
processing stopped.

I just can't figure out how to implement this functionality in
Tkinter.  Any ideas??  Once the "start processing" callback runs, I
don't know how to get the Abort button to interupt the callback.  I
tried polling the state of the Abort button periodically while in the
"start processing" callback but the state doesn't get updated until
the "start processing" callback finishes.  (e.g. currentstate =
abortButtonHdl.config()[state][4])

How can one find out what events have occured? or a list of callbacks
that are queued for execution because multiple buttons have been
pressed?  Can one prematurely force an executing callback to
terminate?

Regards
Andrew



More information about the Python-list mailing list