WIDGET_AUTO_BASE

This function is used to create the top-level base widget for any auto-managed ENVI Classic widget. The function returns the widget ID of the newly created base.

An alternative is to use the WIDGET_ID property to ENVI along with the WIDGET_BASE routine in IDL.

Syntax

Result = WIDGET_AUTO_BASE([, GROUP=widget ID] [, TITLE=string] [, /XBIG] [, /YBIG])

Keywords

GROUP (optional)

Use this keyword to specify the ID of an existing widget that serves as “group leader” for the newly created widget. When a group leader is killed, for any reason, all widgets in the group are also destroyed. A given widget can be in more than one group. It is not possible to remove a widget from an existing group.

TITLE (optional)

Use this optional string keyword to specify a title for the top-level widget.

XBIG (optional)

Set this keyword if the widget will be large in the horizontal direction.

YBIG (optional)

Set this keyword if the widget will be large in the vertical direction.

Example

This routine is an example of how to select multiple ROIs using a compound widget.

 

PRO ROI_MULTI_SEL

envi_select, title='Input Filename', fid=fid

if (fid eq -1) then return

roi_ids = envi_get_roi_ids(fid=fid, roi_names=roi_names)

if (roi_ids[0] eq -1) then begin

   print, 'No regions associated with the selected file'

   return

endif

 

; Compound widget for ROI selection

base = widget_auto_base(title='ROI Selection')

wm = widget_multi(base, list=roi_names, uvalue='list', /auto)

result = auto_wid_mng(base)

if (result.accept eq 0) then return

ptr = where(result.list eq 1)

print, roi_names[ptr]

print, roi_ids[ptr]

END

API Version

4.2