| Re: event queue [message #37483] |
Tue, 23 December 2003 07:58 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
lyubo writes:
> Is it possible to check the event queue for a particular event?
>
> For example:
>
> while (1) do begin
> if the event has occurred exit
> ..........
> end
Yes, it is possible. Here is the method I use in my ProgressBar
object to check to see if the user has clicked the CANCEL
button or not:
FUNCTION PROGRESSBAR::CheckCancel
; This method checks for a CANCEL Button event. It returns 1
; if an event has occurred and 0 otherwise.
; Check for a CANCEL button event.
IF Widget_Info(self.cancelID, /Valid_ID) THEN BEGIN
event = Widget_Event(self.cancelID, /NoWait)
name = Tag_Names(event, /Structure_Name)
IF name EQ 'WIDGET_BUTTON' THEN self.cancelFlag = 1
ENDIF
RETURN, self.cancelFlag
END
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|