How do I Block Events in wxPython

Philip Semanchuk philip at semanchuk.com
Wed Dec 9 11:43:03 EST 2009


On Dec 9, 2009, at 10:42 AM, Wanderer wrote:

> I have a wxPython program which does some calculations and displays
> the results. During these calculations if I click the mouse inside the
> dialog the program locks up. If I leave the dialog alone the process
> completes fine. I have tried running the function from a separate
> dialog with Show Modal and I have tried using SetEvtHandlerEnabled all
> to no avail. The program is long and occupies several files so I won't
> show the whole thing but here is the calculation part. How do I block
> events?


Hi Wanderer,
I don't have a solution for you but I have three suggestions.

First, your program shouldn't be locking up just because you clicked  
on it. IMO that's the real problem, and discarding events is just a  
band-aid to cover it up. Nevertheless, sometimes a band-aid is an  
appropriate solution and you're the best judge of that.

Second, the wxPython mailing list would be a better place for this  
question.

Third, if you can't seem to resolve the problem, try paring it down to  
a minimal example that reproduces the problem. It's difficult to offer  
suggestions when we can't see the whole code or try the sample code  
ourselves.


Good luck
Philip



More information about the Python-list mailing list