Re: Puzzled about event loops [message #18397] |
Tue, 28 December 1999 00:00 |
Karri Kaksonen
Messages: 27 Registered: October 1999
|
Junior Member |
|
|
David,
Thank you. Your examples show exactly what I was looking for.
I just want to be able to watch the data from different angles
while it is being gathered. It is much more fun to be able
to watch the data as it fills the data buffers than just wait
for several minutes while the MR-scanner is ticking.
To do this I want to be able to access menus and have keyboard
shortcuts that toggle signal displays on/off in real time.
So this is pure entertainment (just like fancy colours).
On Mon, 27 Dec 1999, David Fanning wrote:
> Karri Kaksonen (karri.kaksonen@picker.fi) writes:
>> What I would like to do is to stop event processing in
>> xmanager while I run my long loop and process events
>> one at a time. Can this be done easily?
>
> I'm not sure I entirely understand what you are doing,
> but it sounds similar to my Show Progress indicator
> on my web page:
>
> http://www.dfanning.com/programs/showprogress__define.pro
>
> In any case, I'm out the door skiing, so I can't test it. :-)
>
> Cheers,
>
> David
I hope you had a nice day skiing with lots of sun and little wind.
--
Regards,
Karri
|
|
|
Re: Puzzled about event loops [message #18398 is a reply to message #18397] |
Mon, 27 December 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Karri Kaksonen (karri.kaksonen@picker.fi) writes:
> Is there a way to move the event loop around?
>
> I just want to check some widget events in a
> looong processing loop but the routine
> event = widget_event(hiddenTextID,/nowait)
> always returns with event structure {0, 0, 0}
>
> The strange thing is that if I don't care about
> this but fill in the fields myself then the program
> works as intended. There are actually sensible events
> like keyboard hits getting through somehow.
>
> event = widget_event(hiddenTextID,/nowait)
> ; Fill in event.top that was 0 with something
> ; that xmanager would give me
> event.top = self.tlb
> widget_control, event.top, set_uvalue=self
> ; Call the main event handler directly
> rawgui_events, event
> ; This works like a dream but clutters up the heap
>
> What I would like to do is to stop event processing in
> xmanager while I run my long loop and process events
> one at a time. Can this be done easily?
I'm not sure I entirely understand what you are doing,
but it sounds similar to my Show Progress indicator
on my web page:
http://www.dfanning.com/programs/showprogress__define.pro
In the example program that comes with it (compile the
whole file first), a button event puts you into a big
loop, where events are handled with WIDGET_EVENT.
I don't know why your events are always empty. That
seems strange. They might be so if one of your programs
was modal. Or perhaps even if your programs are blocking,
although this seems less likely to me.
In any case, I'm out the door skiing, so I can't test it. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|