Chris and Andres, thanks for the very quick responses!
Chris: I thought about using wxProgressDialog and Pulse() but the problem is that the function that takes all the time (doDelay() in the example code I posted) has no knowledge of wx. It also does not loop (though it does time step). Have not been able to think of a way to get round this one.
Andrea: I am using Python 2.4 and wxPython 2.6 and they don't seem to like wx.SafeYield??
Alun
···
At 20:07 14/11/2007, you wrote:
On Nov 14, 2007 1:57 PM, Alun Griffiths <alun.griffiths@dsl.pipex.com> wrote:
> Hi
>
> I am trying to set up a frame that does something visual (eg .shows a bar
> moving backwards and forwards) while the program is doing some calculations
> behind the scenes. I hacked the following from the wxPython examples but
> nothing happens in the "progress window". Could somebody please point me
> in the right direction (preferably without using threads, if this is
> possible). Thanks in advance!
>There's a prebuilt wxProgressDialog class for doing this. You can make
it "busy" by calling the Pulse() method every so often in your loop.Try not to do things that result in wx events being processed
(especially not wx.CallAfter) while the progress dialog is being shown
- it spins the event loop in-place (it's designed to be used from
within a blocking loop in C++) and can result in your events
processing where you don't expect them.---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org