Widgets: group leader and procedures [message #37542] |
Sat, 03 January 2004 22:33 |
Karthik
Messages: 10 Registered: December 2003
|
Junior Member |
|
|
Hello All,
I have a main programme with a widget base and it includes a widget
button called "Alalyse Data" - when the user clicks on it I would like
to execute the bit of code called "alalyse_simset_data", so the thing
looks like this (not exactly the same but the code below is illustrative)
;-----------------------------------------
Pro main_programme
tlb = widget_base()
analyse = widget_button(row5, value = 'Analyse Data', $
Event_PRO= 'analyse_simset_data')
<etc>
widget_control, tlb, /realize
state={ bunch of stuff}
pstate = Ptr_new(state, /no_copy)
widget_control, tlb, set_uvalue = pstate
xmanager, 'make_random_activity', tlb
END
;-----------------------------------------
Now I would like, for clarity, the analyse_simset_data bit of code to be
a completely independent file and I would like that to contain a widget
as well.
;-----------------------------------------
PRO analyse_simset_data, event
widget_control, event.top, get_uvalue = pstate
base2=widget_base( ?????????? )
END
;-----------------------------------------
The ????? marks refer to my doubts on the subject: how do you pass on
the group leader information in the state pointer so that killing the
main widget from main_programme kills the widget created in
analyse_simset_data as well? Is the group leader information a string?
Are there any rules I should follow when a procedure invoked my a main
programme creates a widget? Any advice/suggestion would be greatly
appreciated.
Thanks,
Karthik.
|
|
|