wxPython and threading issue

sjdevnull at yahoo.com sjdevnull at yahoo.com
Thu Sep 28 23:18:43 EDT 2006


Patrick Smith wrote:
> Hi,
> I'm hoping someone here will be able to help as I've been struggling with
> this problem for a few days now.
>
> I'm working on an application that is creating a ProgressDialog, and then
> creating a thread that runs a function from another module in the program.
>
> The problem is, when the cancel button on the ProgressDialog is pressed, the
> thread that was created continues to run.  How can I make it so that when
> the cancel button on the dialog is clicked, the spawned thread dies?

Have the main thread set a flag telling the worker thread to exit, and
have the worker thread check that periodically when it knows it's in a
safe state to exit.




More information about the Python-list mailing list