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

Home » Public Forums » archive » Re: Canceling or clearing TIMER 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: Canceling or clearing TIMER events [message #55753] Fri, 07 September 2007 10:14 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Sep 7, 9:38 am, David Fanning <n...@dfanning.com> wrote:
> M. Katz writes:
>> The IDL Help explanation of CLEAR_EVENTS isn't clear enough to say
>> whether it applies in this case. I can envision a case where the user
>> closes the widget, and then the event arrives all dressed up with
>> nowhere (no valid widget IDs) to go.
>
> I would guess this is what happens. CLEAR_EVENTS will clear
> events that are on the event queue, but your timer event hasn't
> been dispatched to the queue yet, so it can't be cleared.
>
> I'd say you will probably have to put a KILL_NOTIFY on
> your TLB and delay destroying the widget until that last
> timer event shows up.
>
> Cheers,
>
> David
>
> P.S. Of course, there is always the chance that IDL is
> smart enough to NOT send the timer to a widget that
> doesn't exist, but I would think the chance is vanishingly
> small. :-)


In my simple test case below, it seems like IDL is smart enough not to
send an event to widget that doesn't exist. At least I get no error
messages when I kill the widget between events (i.e. with an event
still "out there"). Did you just want to clean up properly or was
there something you need to do with that event?

pro test_event, event
print, 'Got event'
widget_control, event.id, timer=5.0
end


pro test
tlb = widget_base(/column)
draw = widget_draw(tlb)
timer = widget_base(tlb, uname='timer')

widget_control, tlb, /realize
widget_control, timer, timer=5.0
xmanager, 'test', tlb
end

Mike
--
www.michaelgalloy.com
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Image overlapping
Next Topic: Supervised classification under IDL

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

Current Time: Sun Oct 12 13:06:21 PDT 2025

Total time taken to generate the page: 2.39778 seconds