Re: Retrieve content of Droplist [message #15289 is a reply to message #15288] |
Mon, 03 May 1999 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Thomas C. Stubbings (stubbing@fbch.tuwien.ac.at ) writes:
> Although it may be trivial, I cannot manage to retrieve the currently
> selected value of a droplist (the online help of IDL is somehow a bad
> joke...). It is defined as follows:
>
> WID_DROPLIST_RULEWT = Widget_Droplist(WID_BASE_0, $
> UNAME='WID_DROPLIST_RULEWT' ,XOFFSET=4 ,YOFFSET=45 $
> ,SCR_XSIZE=135 ,SCR_YSIZE=23 ,TITLE='Fusion rule' ,VALUE=[ $
> 'average', 'waverage', 'maximum', 'minimum', 'himaximum', $
> 'hifirst', 'hisecond', 'hi/lo', 'lo/hi' ])
When you are in the business I'm in, this is what is known
as "good marketing", not a "bad joke". :-)
You can obtain the index number of the current
droplist selection like this. (I assume the droplist
identifier is in the "info" structure, and that the
droplist "values" are in the UVALUE of the droplist,
so they are handy.)
Widget_Control, info.droplistID, Get_UValue=dropValues
currentSelection = Widget_Info(info.droplistID, /Droplist_Select)
Print, dropValues[currrentSelection]
Cheers,
David
P.S. This is only about the 10th time I've answered this
question. I think I'll make a tip and put it on my web page.
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|