Stop a duty in a Tkinter program

Ville Vainio vvainio at karhu.tp.spt.fi
Wed Jul 18 09:40:05 EDT 2001


XiaoQin Xia <XQ.Xia at ccsr.cam.ac.uk> writes:

> I am programming with Tkinter. After the user click "Go" button or menu,
> my program will carry out some operation which won't stop until the end
> time (which is set by user) reach. In order to let user interupt the
> operation, a "Stop" button is present. But during the period of the
> operation, my program is not able to respond to any click at all, it
> seems dead before the operation finished.  How can I terminate the
> operation without exit the program? Any help is welcome.

Well, since you accept *any* help, I must say, not knowing that much
about Tkinter, that you have to start the operation in it's own thread
so that Tkinter message loop may proceed and the button becomes
clickable. Make clicking "stop" just kill the thread or signal it in a
more polite fashion (flag).


-- 
Ville Vainio - http://www.tp.spt.fi/~vvainio - ICQ #115524762
 Wild geese have no intention to cast a reflection
 Water has no mind to assume their form



More information about the Python-list mailing list