Re: State of non-exclusive button [message #26383] |
Mon, 03 September 2001 01:11  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
"K. Bowman" wrote:
>
> How do you get the state (checked or unchecked) of a non-exclusive
> (toggle) button?
>
> According to the Reference Guide there is a SET_BUTTON keyword to
> WIDGET_CONTROL, but no GET_BUTTON keyword. The GET_VALUE keyword
> returns the value of the button *label*. I guess that is consistent
> with using WIDGET_BUTTON(id, VALUE = 'Button Label') to create the
> button, but it seems to me to confuse the notions of 'value' and
> 'label'.
>
> Thanks, Ken
I have a compound widget which might help.
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/cw_buttons.tar.gz
PRO test_event,ev
WIDGET_CONTROL,ev.id,get_uval=cmd
WIDGET_CONTROL,ev.top,get_uvalue=b
CASE cmd OF
'done':WIDGET_CONTROL,ev.top,/dest
'FF': BEGIN
WIDGET_CONTROL,ev.id,get_value=v
print,v.set
idx=(WHERE(v.set EQ 1,count))[0]
IF count GT 0 THEN BEGIN
value={value:[strtrim(SINDGEN(idx+1),2)],set:MAKE_ARRAY(idx+ 1,/LONG,value=1)}
WIDGET_CONTROL,b,set_value=value
ENDIF
END
ELSE:
ENDCASE
END
PRO test
a=WIDGET_BASE(row=2)
value={value:['MIN','SPEC','DEFAULT','MAX'],set:[1,0,0,0]}
b=cw_buttons(a,value=value,uvalue='FF',row=1,button_xsize=60 ,frame=2,xoffset=0,yoffset=0,button_frame=1)
value={value:['0'],set:[1]}
b=cw_buttons(a,value=value,uvalue='EF',col=2,/nonexclusive,f rame=2,xoffset=20,yoffset=0,button_frame=1)
d=WIDGET_BUTTON(a,val='done',uval='done')
WIDGET_CONTROL,/realize,a,set_uvalue=b
XMANAGER,'test',a
END
regards
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======
read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
|
|
|