Re: How do I Block Events in wxPython

2009-12-10 Thread Stephen Hansen
On Wed, Dec 9, 2009 at 10:21 PM, Frank Millman fr...@chagford.com wrote: 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

Re: How do I Block Events in wxPython

2009-12-10 Thread Frank Millman
Stephen Hansen wrote: On Wed, Dec 9, 2009 at 10:21 PM, Frank Millman fr...@chagford.com wrote: I also need to block events in my wxPython app, though the time duration is very short. I have a separate thread that sends notification of gui events to a server, and waits for a response. I

Re: How do I Block Events in wxPython

2009-12-10 Thread Stephen Hansen
On Thu, Dec 10, 2009 at 6:01 AM, Frank Millman fr...@chagford.com wrote: Another approach is to use wnd.CaptureMouse() on a particular control which doesn't really respond to anything. Just be sure to ReleaseMouse() later and follow the instructions in the docs about capturing that

Re: How do I Block Events in wxPython

2009-12-10 Thread Frank Millman
Stephen Hansen wrote: Well if you have a legitimate case for pre-empting the event loop with these periodic regular short blocking moments (it seems you may), I think what you want to do is overwrite FilterEvent on your App object. You can then make that flag something you set on the app,

How do I Block Events in wxPython

2009-12-09 Thread Wanderer
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

Re: How do I Block Events in wxPython

2009-12-09 Thread Philip Semanchuk
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

Re: How do I Block Events in wxPython

2009-12-09 Thread zeph
The wxPython wiki actually has a page on dealing with long running tasks called from event handlers called (surprise surprise): http://wiki.wxpython.org/LongRunningTasks Hint: the second to last example on that page has the clearest example - using a worker thread object to do your DoEfficiency()

Re: How do I Block Events in wxPython

2009-12-09 Thread r0g
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. If anything in your GUI app takes a non trivial

Re: How do I Block Events in wxPython

2009-12-09 Thread Wanderer
On Dec 9, 11:48 am, r0g aioe@technicalbloke.com wrote: 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

Re: How do I Block Events in wxPython

2009-12-09 Thread Jeff Peck
Philip Semanchuk wrote: 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.

Re: How do I Block Events in wxPython

2009-12-09 Thread Stephen Hansen
On Wed, Dec 9, 2009 at 9:06 AM, Wanderer wande...@dialup4less.com wrote: Found another strange bug (Strange to me, anyway). int(0.8 * 10.0) = 7. Had to change the code to int(0.8 * 10.0 + 0.0001). http://effbot.org/pyfaq/why-are-floating-point-calculations-so-inaccurate.htm Floating point

Re: How do I Block Events in wxPython

2009-12-09 Thread Dave Angel
Wanderer wrote: snip Found another strange bug (Strange to me, anyway). int(0.8 * 10.0) 7. Had to change the code to int(0.8 * 10.0 + 0.0001). Floating point is intrinsically imprecise. The value 0.8 cannot be exactly represented in IEEE fp notation (binary). One answer is to round()

Re: How do I Block Events in wxPython

2009-12-09 Thread Frank Millman
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