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 #35505 is a reply to message #35502] Wed, 18 June 2003 09:07 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Ian Dean wrote:
> Hi All,
> Is it possible to clear any pending widget events without causing an
> existing event handler to be called?
>
> I have some software that establishes an event handler using the
> EVENT_PRO flag on a top-level base (I know I should use XMANAGER - but this
> is not suitable in this case).
> This works well, except that one function is time-consuming and users
> tend to hit the button (or other buttons) a number of times while waiting.
> What I would like to do is to clear the backlog of these events when the
> desired button action is complete.
> I have tried using WIDGET_EVENT with /NO_WAIT until no event is
> returned, but using this calls the current event handler, which I don't want
> at this point. I have also tried setting the EVENT_PRO to a null string
> before handling the desired function and then resetting it back afterwards.
> Neither of these methods are satisfactory and I was wondering if there
> is a better way.
>
> In anticipation,
> Ian
>
>

Hello,

I'm not sure how you are using the EVENT_PRO of your top level base
without using Xmanager - so I'm not 100% sure I even understand the
problem. But that won't restrain me from making suggestions; all my
best stuff comes out of bliss-rich ignorance!

(1) There is the CLEAR_EVENTS keyword to WIDGET_CONTROL

From online help IDL 5.6

CLEAR_EVENTS
This keyword applies to all widgets.
If set, any events generated by the widget hierarchy rooted at Widget_ID
which have arrived but have not been processed (via the WIDGET_EVENT
procedure)are discarded.

(2) I have never tried setting the EVENT_PRO string to null after it has
been set to the name of a real event handler, but I have often
redirected events to a real dummy event handler - one that does nothing
except return immediately. When appropriate, you can then do as you do
now - redirect events to the original event handler.

(3) You could make the the offending button insensitive (via SENSITIVE
keyword to WIDGET_CONTROL) - but then you will lose your chance to abort
early.

(4) You could chnage the name of the button, while processing, to "For
pity's sake, don't press this button!"

How's that for wild hand-waving?

Ben
[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: Mon Oct 13 02:43:48 PDT 2025

Total time taken to generate the page: 3.76275 seconds