How to get values from a widget [message #10413] |
Mon, 24 November 1997 00:00 |
Inigo Garcia
Messages: 13 Registered: June 1997
|
Junior Member |
|
|
Hi:
I have a program that can plots several things in a Postcript file, and
I want to ask the user which ones he wants to plot, via a widget
interface. I want to make a call like to this widget, and know which
plots are desired, but I can not get it.
Here follows a part of the code:
> n=10
> base = widget_base(title='OPTIONS FOR THE ANALYSIS',/modal,/col,group_le=par,$
> /floating,frame=3)
> but = widget_base(base,/col,/nonexclusive,/frame)
> for iii=0,n-1 do begin
> b(iii)= widget_button(but,event_pro='widget_std_event',val=b_str(iii ),uval=1)
> widget_control,b(iii),/set_button
> options(iii) = 1
> endfor
> ok = widget_base(base,/row)
> for iii=0,1 do fin(iii) = widget_button(ok,val=fin_str(iii),uval=0)
> state = {b:b,options:options,fin:fin}
> widget_control,/realize,base,set_uvalue=state
> xmanager,'widget_std',base
> print,state.options
In the "options" variable I store which figures are going to be plotted
(option(i)=1, or not (option(i)=0). This variable is changed via the
buttons in the event handler. But when I destroy the widget, and print
the state.options, I get the initial values (all of them 1). How can I
get information that was created within a widget ??
Thank you.
--
\\|//
(o o)
+-----------------------oOOo-(_)-oOOo----------------------- --+
| I~nigo Garcia Ruiz |
| Kapteyn Instituut Phone: +31-(0)50-3634083 |
| Landleven 12 Fax: +31-(0)50-3636100 |
| 9747 AD GRONINGEN (Netherlands) e-mail: iruiz@astro.rug.nl |
+----------------------------------------------------------- --+
|
|
|