Re: variable # of widgets [message #8712 is a reply to message #8707] |
Thu, 17 April 1997 00:00  |
Tim Patterson
Messages: 65 Registered: October 1995
|
Member |
|
|
David wrote:
>
> Hi,
>
> Does anyone know how to make a pull down menu with a variable number of
> selectable entries?
>
> I have a possible number of, say, 1 to 50 sensors. I want to read a file
> containing the name of each sensor, place each name in a widget pull
> down menu, and then when the user selects an entry from this menu, graph
> the data from the corresponding sensor. Is this possible?
>
> Thanks in advance for any help!
>
> cheers!
> David Katz
It's possible, but might be the wrong approach. Having 50 items in
a pull-down menu under X/Motif would mean that it would be very likely
that some of the menu would disappear off screen.
A better solution might be to read your names into a string
array then use this to set up a scrollable List Widget from
which the user can select the name required. You can change
the contents of a list widget using the WIDGET_CONTROL procedure
with SET_VALUE = my_string_array, or you can do this at the time
you create the list widget.
You can do the same thing with a droplist widget, of course, but
as I said above, you may run into trouble.
Hope this helps (and I understood the question properly)
Tim
|
|
|