Mark Rivers object example [message #9339] |
Fri, 20 June 1997 00:00 |
Ronn Kling
Messages: 3 Registered: June 1997
|
Junior Member |
|
|
Greetings,
While playing with Mark Rivers object example I noticed some interesting
behavior. As he mentions in his example, Xmanager can't have the main
event handler be an object method, but the event_pro keyword can! Here
is my version of Mark's example.
;Begin example---------------------------------------------
function example::init
base = widget_base(uvalue=self,xsize=100,ysize=100)
void = widget_button(base,value='exit',event_pro='example::event')
widget_control,base,/realize
xmanager,'example::init',base,/no_block
return,1
end
pro example::event
;no need for an event variable, the implicit self is the event
;structure!!!
widget_control,self.top,/destroy
end
pro example__define
data = fltarr(30)
t = {example,data:data}
end
;end example---------------------------------------------------
I have only tried this out on an alpha, but if this really is a feature
of 5.0 then it opens up some interesting programming possibilities.
-Ronn Kling
Ronn Kling Consulting
|
|
|