comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Running processes in parallel
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Running processes in parallel [message #49243 is a reply to message #49242] Wed, 12 July 2006 13:25 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
WorkerAnt wrote:
> Currently, there is a for loop in my program that takes anywhere from a
> couple of seconds to a couple of minutes. (The procedure runs a step by
> step animation using the wait function). It's called from an event
> handler whenever a button in the widget is pushed. I want to be able to
> stop anytime in the middle of the animation when another button is
> pressed. (As opposed to the ctrl break method).
> However, the event handler is unable to process the stop button getting
> pushed until the for loop procedure is complete, thus defeating the
> purpose. Is there any way to run two procedures in parallel? Or a time
> independent way to have one take priority over another?
> Barring these two possibilities working, is there any other way of
> having the animation stop?
>

Yes there is a way to do this: use timer events. You'll need someplace
to store data (like a "state" structure, member variables of an object,
etc.) The basic steps would be, in your current event handler:

1. If the event was a "stop" button, then set a "stop" flag and exit.
2. If the "stop" flag is set, exit.
2. Do one step and record that you did the step (so you know which
step to do the next time).
3. Set a timer (using "WIDGET_CONTROL, id, TIMER=t" instead of using
"WAIT, t").

You could probably do this using the IDL_IDLBridge now, in a way that is
more in line with your original strategy. I don't have a lot of
experience using it, but it seems like there is a fair amount of
overhead in using it.

Mike
--
www.michaelgalloy.com
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Rendering order
Next Topic: Re: IDLWAVE Mac OS X

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 13:03:38 PDT 2025

Total time taken to generate the page: 0.95860 seconds