This function returns a compound widget that allows you to select multiple items from a list, and it returns the base ID of the widget. ENVI Classic uses this widget for spectral subsetting. An interactive ENVI Classic session is required to run this function.
Syntax
Result = WIDGET_MULTI(Base [, AUTO_MANAGE={0 | 1}] [, BUTTON_BASES=variable] [, DEFAULT=array], LIST=string array [, /NO_RANGE] [, PROMPT=string], UVALUE=value [, YSIZE=integer])
Arguments
Base
This is the ID of the base widget.
Keywords
AUTO_MANAGE (optional)
Use this keyword to specify how ENVI Classic auto-manages the widget with AUTO_WID_MNG. The keyword value specifies if the widget must have a defined value. Setting this keyword to a value of 1 requires that the widget has either a default value or a value that you enter. Setting this keyword to 0 does not require a value. Do not use this keyword for user-managed widgets.
BUTTON_BASES (optional)
Use this keyword to specify a named variable that holds the returned array of the widget ID of each button. Specifying this keyword allows you to manage each button by making calls to the IDL routine WIDGET_CONTROL.
DEFAULT (optional)
Use this keyword to specify a byte array of zeros and ones indicating the default selection state of each item in the multi-list. A value of 1 indicates that the item is selected, and a value of 0 indicates it is not selected.
LIST
Use this keyword to specify an array of string values for the menu buttons.
NO_RANGE (optional)
Set this keyword to disable selection of items by specifying a range.
PROMPT (optional)
Use this keyword to specify the prompt string to use for the widget.
UVALUE
Use this keyword to assign a “user value” to the widget. This value may be of any data type and organization. The user value exists entirely for your convenience. For widgets managed by the ENVI Classic function AUTO_WID_MNG, UVALUE is a tag name in the returned anonymous structure. For user-managed widgets, you can set and use UVALUE however you wish. You must set UVALUE for all compound widgets.
YSIZE (optional)
Use this keyword to specify the height of the widget in pixels. The default value is 350.
Widget Event
When the widget is not auto-managed, widget events set event.result to an array of zeros and ones, where a 1 indicates a selected item.
Example
Create a simple compound widget to select multiple items from a list. If the items are properly selected, then print the result.
PRO ENVI_WIDGET_MULTI_EX
compile_opt IDL2
base = widget_auto_base(title='Multi test')
list = ['Item 1', 'Item 2', 'Item 3', 'Item 4']
wm = widget_multi(base, list=list, uvalue='list', /auto)
result = auto_wid_mng(base)
if (result.accept eq 0) then return
print, 'Selected Items', where(result.list eq 1)
END
API Version
4.3