Widget event problem [message #5173] |
Mon, 16 October 1995 00:00 |
gfu
Messages: 10 Registered: October 1995
|
Junior Member |
|
|
Hi,
In IDL widget event handling, is it possible to start another event inside
an event before it (the parent event) finish ?
The example included at the end demonstrated that I cannot do this.
Any comment or soulution ?
Gary
;*********************************************************** *******
pro event_EVENT, event
Widget_Control, event.top, Get_UValue=gvar
WCMD = gvar.WCMD
CASE event.id OF
WCMD.quit: BEGIN
WIDGET_CONTROL, event.top, /DESTROY
RETURN
END
WCMD.button1: BEGIN
print, 'inside button1 event'
WCMD.flag = 1
event = {ID:WCMD.button2, TOP:WCMD.base, HANDLER:WCMD.base}
WIDGET_CONTROL, event.ID, SEND_EVENT=event
WHILE (WCMD.flag EQ 1) DO BEGIN
ENDWHILE
END
WCMD.button2: BEGIN
print, 'inside button2 event'
WCMD.flag = 0
END
ELSE: BEGIN
END
ENDCASE
END
;*********************************************************** *****************
pro event
; setup gui widgets
WCMD = {WCMD, base:0L, button1:0L, button2:0L, quit:0L, flag:0L}
WCMD.base = WIDGET_BASE(xoffset=50, yoffset=50, $
title="Test event")
base0 = WIDGET_BASE(WCMD.base, /COLUMN)
base1 = WIDGET_BASE(base0, /ROW)
base4 = WIDGET_BASE(base0, /ROW)
WCMD.button1 = WIDGET_BUTTON(base4, VALUE="button1")
WCMD.button2 = WIDGET_BUTTON(base4, VALUE="button2")
WCMD.quit = WIDGET_BUTTON(base4, VALUE="Quit")
WIDGET_CONTROL, /REAL, WCMD.base
gvar = {WCMD:WCMD}
WIDGET_CONTROL, WCMD.base, SET_UVALUE=gvar
XMANAGER, "event", WCMD.base, event="event_EVENT", GROUP=group
end
|
|
|