Problem with long running process

Hi,
I think I have a problem with a long running process. I read the
following link and tried to implement few solutions but could not make
it work.
http://wiki.wxpython.org/LongRunningTasks

Basically I have a gui (a kind of movie player) that shows a movie
using images. So in a for loop I iterate over images and show them
like a movie. I use wx.BufferedPaintDC to show the image. When I am in
the for loop, the gui does not respond to any button clicks etc.

I tried the wx.Yield() trick. I call the wx.Yield() before I paint an
image. But it is not responding properly.
I tried moving image painting to onIdle() method which paints an image
everytime it is called. But it only paints when I move my mouse. If I
just sit idle it won't do anything.

I tried using multiple threads, but it also failed and gave some
errors. Heard that multiple threads is not robust.

There are few things I didn't understand. The link talks about long
process which I assume are non-gui tasks. Does painting image using
wx.BufferedPaintDC on a panel come under non-gui task which is taking
the majority of time? If not why isn't onIdle called when painting is
over? I was expecting it continuously paints on the panel.

Can any one give me some suggestions.

Cheers,
dksr

Try using a wx.PyTimer and paint one frame each time the handler is called.

···


Best Regards,
Michael Moriarity

Michael Moriarity wrote:

Try using a wx.PyTimer and paint one frame each time the handler is called.

And calling Yield() each time as well.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Try using a wx.PyTimer

Hurray, this works! Thanks for the idea.

···

On Mar 15, 11:39 pm, Christopher Barker <Chris.Bar...@noaa.gov> wrote:

Michael Moriarity wrote:
> Try using a wx.PyTimer and paint one frame each time the handler is called.

And calling Yield() each time as well.

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Bar...@noaa.gov