Re: retrieval of droplist elements [message #13733] |
Wed, 02 December 1998 00:00 |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
David Borland wrote:
>
> Hellu,
> Is there a way to retrieve the elements of a widget_droplist from the
> event? I know that the event generates an index value for the element
> selected in the droplist, but I don't know how to retrieve the list to
> figure out what this element is. Currently I use a hard coded case
> statement that uses the index to figure out what to do next, but what I
> would like is a way to retrieve the element with out either the case
> statement, and without passing the array of element names. Any suggestions?
>
> David Borland
> Electrical Geodesics
David -
It would sure make a lot of people happy if the event from a Droplist
widget would include the text of the selected choice (this is what
I'm assuming you mean by "element"). Most people create an array
of choices, use it to create the Droplist widget, and then store it
in the widget's info structure so you can use the EVENT.INDEX from
the droplist event to index this array in your event handler.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|