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 #35502 is a reply to message #35501] Wed, 18 June 2003 13:22 Go to previous messageGo to previous message
MKatz843 is currently offline  MKatz843
Messages: 98
Registered: March 2002
Member
> Is it possible to clear any pending widget events without causing an
> existing event handler to be called?

You can use
widget_control, widget_ID, /CLEAR_EVENTS
but you should consider a few things in advance.
When the computer is busy with a long calculation and the user hits
the button repeatedly, I believe that the *operating system* may queue
the events. This may affect your ability to clear the events since IDL
may not have seen the events yet. Certainly an experiment will settle
the issue quickly.

I've found that this can be a thorny issue when you give the user a
"stop" button for something. If some other button is clicked several
times and is taking a while to process things, then the stop button's
event isn't able to magically jump ahead of the other queued events.
So stop buttons can't solve itchy-button-finger syndrome.

So, that said, I think a solution you may want to consider is this.
When the user presses the button, set the cursor to hourglass so the
user will see that it's calculating, and make the offending button
insensitive until the calculation is complete.
widget_control, button_ID, SENSITIVE=0 or 1.
widget_control, HOURGLASS=1 or 0 (I think that's correct).

Then the button can't generate new events until you're ready.

MKatz
[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: Sat Oct 11 07:50:13 PDT 2025

Total time taken to generate the page: 0.88158 seconds