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

Home » Public Forums » archive » Re: cannt disable widget timer event?
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: cannt disable widget timer event? [message #47213 is a reply to message #47212] Mon, 30 January 2006 21:32 Go to previous messageGo to previous message
Weihua FANG is currently offline  Weihua FANG
Messages: 26
Registered: January 2006
Junior Member
Hi, David,

here is a examle of my code. I cancel timer event by setting a negative
value. How will you do that?


PRO timer_example_event, ev

WIDGET_CONTROL, ev.ID, GET_UVALUE=uval
IF (TAG_NAMES(ev, /STRUCTURE_NAME) EQ 'WIDGET_TIMER') THEN BEGIN
PRINT, 'Timer Fired'
WIDGET_CONTROL, ev.TOP, TIMER=1
ENDIF

CASE uval OF
'timer' : BEGIN
WIDGET_CONTROL, ev.TOP, Timer = 1
END
'otherjobs' : BEGIN
print, 'other jobs here'
END
'stoptimer' : BEGIN
; set a negative value to slope timer
WIDGET_CONTROL, ev.TOP, TIMER=-1
END
ELSE:
ENDCASE

END

PRO timer_example

base = WIDGET_BASE(/COLUMN, UVALUE='base')
b1 = WIDGET_BUTTON(base, VALUE='Fire event', UVALUE='timer')
b2 = WIDGET_BUTTON(base, VALUE='Other job', UVALUE='otherjobs')
b3 = WIDGET_BUTTON(base, VALUE='Stop Timer', UVALUE='stoptimer')
WIDGET_CONTROL, base, /REALIZE
XMANAGER, 'timer_example', base, /NO_BLOCK

END


David Fanning 写道:

> Weihua FANG writes:
>
>> just found that setting timer to a negative value would disable timer
>> event. :-)
>
> Uh, huh. And how is that different from NOT setting
> the next timer event?
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: creating multiple files
Next Topic: The plot including another plot

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

Current Time: Thu Oct 09 15:01:31 PDT 2025

Total time taken to generate the page: 0.88089 seconds