EVENT_PRO [message #73776] |
Mon, 29 November 2010 08:25 |
silje
Messages: 4 Registered: October 2010
|
Junior Member |
|
|
Hey, I'm trying to structure my IDL program into several event
handlers, e.g. one procedure that opens a file, one that save data
etc. To do this I have used EVENT_PRO like this:
PRO MotionControl
tlb = WIDGET_BASE(column=1, title='MotionControl', tlb_frame_attr=1,
MBAR=bar )
file_menu = WIDGET_BUTTON(bar, VALUE='File', /MENU)
file_bttn1 = WIDGET_BUTTON(file_menu, VALUE='Open dataset',
UVALUE='OpenDat', EVENT_PRO = 'OpenData')
file_bttn2 = WIDGET_BUTTON(file_menu, VALUE='Save dataset',
UVALUE='SaveDat', EVENT_PRO = 'SaveData')
............................................................ ..........................
etc
WIDGET_CONTROL, tlb, /realize
XMANAGER, 'MotionControl', tlb
end
In this way I have one event handler that is called
MotionControl_event that takes care of all the events not handled by
specified EVENT_PRO. I don't know if this is a really bad way of
structuring my code, even though it does work. Can somebody give me
some tips?
Thanks!
Silje
|
|
|