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

Home » Public Forums » archive » Re: Clearing widget events
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: Clearing widget events [message #35499] Wed, 18 June 2003 14:38 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Craig Markwardt" <craigmnet@cow.physics.wisc.edu> wrote in message
news:onel1rglmw.fsf@cow.physics.wisc.edu...
>
> Hmmm, I've found that when doing something like a "stop" button, I
> basically bypass XMANAGER, and simply poll events for that button
> using WIDGET_EVENT() at a convenient point in the computation loop. I
> am able to receive events for the "stop" button even if other buttons
> have been clicked first. Those other clicks will be ignored until the
> computation is finished and XMANAGER is able do deliver them again.

Hmmm. when I want a widget application to be interruptible I add the
following code (buried inside a function) to the computation loop:

repeat begin
event = widget_event(base, BAD_ID=bad_id, /NOWAIT)
endrep until event.id eq 0

Here base is the ID of the top-level base. This causes all events queued for
the base to be processed. The event handlers for the buttons themselves
don't have to do anything special.

Just my $0.02 worth. I don't know if this method is better or worse on
balance than Craig's. It makes programming a bit simpler, I think, but it
may be more dangerous because it doesn't stop the user from doing something
inappropriate, like triggering the window manager's "close" command.

BTW, I don't recall why I have BAD_ID in there. Probably for debugging.


--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Spherical gridding
Next Topic: Re: sec : U Re: Coordinates from SLIDE_IMAGE

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

Current Time: Thu Oct 09 22:06:13 PDT 2025

Total time taken to generate the page: 0.47821 seconds