Re: list widget [message #21539 is a reply to message #21496] |
Wed, 30 August 2000 23:13   |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Stuart Robertson wrote:
>
> Wow, you guys are getting a bit philosophical here. This is my first
> posting and OK you definitely have my respect, but could you possibly
> lower yourself to helping with questions like 'Why I don't get multiple
> element output from my list widget?' please?
>
> Here is my widget_definition:
> Widget_list(tlb,sensitive=1,/multiple,ysize=26,event_pro='an ypro')
>
Dear Stuart,
we are using a compound widget to select from a list.
You can do a selection by typing something in the text field.
Example:
PRO test_event,ev
WIDGET_CONTROL,ev.id,get_uval=cmd
WIDGET_CONTROL,ev.top,get_uvalue=b
CASE cmd OF
'done':BEGIN
WIDGET_CONTROL,b,get_value=v
IF v.list_selected[0] NE -1 THEN PRINT,v.list[v.list_selected]
WIDGET_CONTROL,ev.top,/dest
END
'FF':BEGIN
WIDGET_CONTROL,ev.id,get_value=v
IF v.button_pressed EQ 1 THEN BEGIN
replace_tag,v,'list_selected','list_selected',INDGEN(2)
WIDGET_CONTROL,ev.id,set_value=v
ENDIF
END
ELSE:
ENDCASE
END
PRO test
a=WIDGET_BASE(row=2,/frame)
value={label:'[0,1]',list:STRTRIM(SINDGEN(40),2),text:'',but ton:'PRESELECTION',$
list_selected:-1,button_pressed:0,description:'TEST'}
b=cw_list(a,value=value,uvalue='FF',frame=2, XOFFSET=9,$
YOFFSET=15 ,SCR_XSIZE=140 ,SCR_YSIZE=200,$
/text_all_events, text_xsize=19,/text_editable, $
/list_multiple,list_ysize=10,list_xsize=20,$
label_xsize=100,$
button_ysize=20 )
d=WIDGET_BUTTON(a,val='done',uval='done')
WIDGET_CONTROL,/realize,a,set_uvalue=b
XMANAGER,'test',a
END
For further routines copyright and licence.
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
The routine itselfs.
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/cw_list.tar.gz
The routine as loadable module.
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/cw_list.sav
Reimar
-
Attachment: CW_LIST.GIF
(Size: 3.09KB, Downloaded 107 times)
|
|
|