Combobox / Droplist index problem [message #40264] |
Fri, 30 July 2004 03:02 |
basson
Messages: 4 Registered: June 2003
|
Junior Member |
|
|
I have stumbled across a problem with retrieving the index in a
combobox if you have some items with identical text. The "old"
droplist returns the correct index, but the combobox widget returns
the 1st index that matches the currently selected text (an example is
included below). Am I retrieving the index incorrectly? Is there some
other way to get the combobox to work (I am only using it instead of
the droplist because of RSI's recommendation in the manual)?
Thanks,
Jacques
pro test_event, ev
compile_opt idl2
widget_control, ev.id, get_uvalue=uval
case uval of
'change' : print, ev.index, widget_info(ev.id,
/combobox_gettext)
'change1' : print, ev.index, widget_info(ev.id,
/droplist_select)
else :
end
end
pro test
compile_opt idl2
base = widget_base (/column)
cbox = widget_combobox(base, /dynamic_resize, uvalue='change',
value=['0','1','2','3','2'])
dlist = widget_droplist(base, /dynamic_resize, uvalue='change1',
value=['0','1','2','3','2'])
widget_control, base, /realize
xmanager, 'test', base, /no_block
end
|
|
|