Droplist widgets display a single entry from a list of possible choices. To choose from the list, click the droplist, then click on the item in the list. On Motif operating systems, the droplist widget looks like a button, which when clicked displays the drop-down list.
When programming in IDL, you create droplist widgets using the WIDGET_DROPLIST function. For more information, see WIDGET_DROPLIST.
For droplist widgets, you can set common attributes and droplist-specific attributes. For a list of common attributes, see Common Attributes. These are the droplist attributes:
The Initial Value attribute specifies the initial list of values that are placed in the droplist widget. The initial value of a droplist can be a scalar string, or it can be a list of strings. By default, this value is not set, and the droplist is empty.
To enter more than one string in the Value field, type in a string, then press Control+Enter (at the end of each line). This moves you to the next line. When you have entered as many strings as you want, press Enter to set the values.
In the generated *.pro file, this value is specified with the VALUE keyword to the widget creation routine.
The Tab Mode attribute specifies what support the widget has for receiving or losing focus through tabbing. By default, this value is set to Inherit.
| Note |
Allowable values are:
| Note |
| Note |
In the generated *.pro file, this value is specified with the TAB_MODE keyword to the widget creation routine. For more information on tabbing among widgets, see Tabbing in Widget Applications.
The Title attribute specifies the title string, or label, for the droplist. This value can be any string. By default, this value is set to NULL.
In the generated *.pro file, this value is specified by the TITLE keyword to the widget creation routine.
For droplist widgets, you can set common event properties and droplist-specific event properties. By default, event values are not set. For a list of events common to all widgets, see Common Events.
This is the event property specific to droplist widgets:
The OnSelectValue specifies the routine that is called when a droplist item is selected. When a user selects an item from a droplist, the widget deselects the previously selected item, changes the visible item on the droplist, and generates an event.
When you set this event value, the calling sequence looks like this in the generated *_eventcb.pro file:
pro <RoutineName>, Event
where RoutineName is the name of the event procedure you specify. Event is the event structure returned when a user selects an item from a droplist. The event structure is of the following type:
{ WIDGET_DROPLIST, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L }
INDEX returns the index of the selected item. This value can be used to index the array of names originally used to set the widget's value.
| Note |