Re: Retrieve content of Droplist [message #15288] |
Mon, 03 May 1999 00:00 |
mgs
Messages: 144 Registered: March 1995
|
Senior Member |
|
|
In article <MPG.1197dd3be091b1c598978e@news.frii.com>, davidf@dfanning.com
(David Fanning) wrote:
> Thomas C. Stubbings (stubbing@fbch.tuwien.ac.at ) writes:
>
...
>> WID_DROPLIST_RULEWT = Widget_Droplist(WID_BASE_0, $
...
> Widget_Control, info.droplistID, Get_UValue=dropValues
...
> 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.
Be sure to add it to the FAQ, too :-)
Folks, just to make sure everyone knows what's available, if you have
something that you see often, please feel free to add it to the FAQ at
<http://www.ivsoftware.com:591/FAQ/>
Afterwards, drop a line to the newsgroup about any additions or changes.
I'd really like to see this take off and be a great resource for all of
us.
--
Mike Schienle Interactive Visuals, Inc.
mgs@ivsoftware.com Remote Sensing and Image Processing
http://www.ivsoftware.com/ Analysis and Application Development
|
|
|
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
|
|
|
Re: Retrieve content of Droplist [message #15290 is a reply to message #15288] |
Mon, 03 May 1999 00:00  |
Henry Chapman
Messages: 10 Registered: February 1997
|
Junior Member |
|
|
"Thomas C. Stubbings" wrote:
>
> 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' ])
>
> Can anyone help? Thanks!
>
> Thomas
In your event procedure:
wid_droplist = widget_info(event.top,
find_by_uname='WID_DROPLIST_RULEWT')
selected = widget_info(wid_droplist, /droplist_select)
From the widget_info help:
DROPLIST_SELECT
This keyword applies to widgets created with the WIDGET_DROPLIST
function.
Set this keyword to return the zero-based number of the
currently-selected
element (i.e., the currently-displayed element) in the specified
droplist
widget.
Henry.
--
Henry Chapman mailto:chapman9@llnl.gov
Information Science & Technology Program phone:(925)423-1580
Lawrence Livermore National Lab fax:(925)423-1488
L-395, 7000 East Ave., Livermore CA 94550
|
|
|