comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » DROPLIST problem in CW_FORM
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
DROPLIST problem in CW_FORM [message #14678] Wed, 24 March 1999 00:00
Quentin Errera is currently offline  Quentin Errera
Messages: 4
Registered: March 1999
Junior Member
Dear all,

I am using the DROPLIST keyword in the porcedure CW_FORM.
I initialize a value (e.g. 4) of the list with the SET_VALUE keyword.
I create the widget using CW_FORM, I do what it ask me but I
don't change the droplist (so I keep the initial value).
The problem is that the tag returned for the DROPLIST is
0 (and not 4).

If anyone can help me,

Quentin.
Re: DROPLIST problem in CW_FORM [message #14774 is a reply to message #14678] Wed, 24 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Quentin Errera (quentin@bira-iasb.oma.be) writes:

> I am using the DROPLIST keyword in the porcedure CW_FORM.
> I initialize a value (e.g. 4) of the list with the SET_VALUE keyword.
> I create the widget using CW_FORM, I do what it ask me but I
> don't change the droplist (so I keep the initial value).
> The problem is that the tag returned for the DROPLIST is
> 0 (and not 4).

Yes, this has always seemed a bit strange to me too, but
what is returned from the droplist is the index number of
the selected item, not that item's "value". So, clearly,
if you want to do something with the values of the
droplist you have to have them around. A good place to put
them is in the "info" structure, where you include all of
the information you require to run your program.

Or, since the values are really only needed by the droplist
itself, I often put the values in the user value of the
droplist itself:

dropValues = SIndgen(10)
realValues = Findgen(10)
dropID = Widget_Droplist(tlb, Value=dropValues, $
UValue=realValues, Event_Pro='Droplist_Events')

Then, the event handler is easy to write:

PRO Droplist_Events, event
Widget_Control, event.id, Get_UValue=realValues
Print, realValues[event.index]
END

Cheers,

David
--
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Looking for a 3D "triangulate" equivalent
Next Topic: Re: statistics on large arrays

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:06:59 PDT 2025

Total time taken to generate the page: 0.00501 seconds