RE: Mark Rivers object example [message #9335] |
Sat, 21 June 1997 00:00 |
mallozzi
Messages: 60 Registered: August 1994
|
Member |
|
|
Hey everyone,
It seems that you can just define a method example::init_event,
and it gets called by XMANAGER as usual; that is, XMANAGER just
appends "_event" for the default event handler.
That is very cool...
One thing I noticed: when the PRINT statement is executed, a blank
line appears after button name is printed.
-bob
IDL> print, !version
{ x86 linux unix 5.0 Apr 28 1997}
; --- BEGIN example__define.pro ---
FUNCTION example::init
base = WIDGET_BASE(UVALUE = self, /COLUMN, XS = 300)
self.widgets.base = base
self.widgets.but = WIDGET_BUTTON(base, VALUE = 'Button')
self.widgets.exit = WIDGET_BUTTON(base, VALUE = 'Exit')
WIDGET_CONTROL, BASE, /REALIZE
XMANAGER, 'example::init', base, /NO_BLOCK
RETURN, 1
END
PRO example::init_event
theEvent = self
WIDGET_CONTROL, theEvent.id, GET_VALUE = theButton
PRINT, theButton, ' button pressed.'
END
PRO example__define
widgets = {example_widgets, base: 0L, but: 0L, exit: 0L}
data = FLTARR(30)
t = {example, widgets: widgets, data: data}
END
; --- END example__define.pro ---
|
|
|