The WIDGET_INFO function is used to obtain information about the widget subsystem and individual widgets. The specific area for which information is desired is selected by setting the appropriate keyword.
Usually this argument should be the widget ID of the widget for which information is desired. If the ACTIVE or VERSION keywords are specified, this argument is not required.
Widget_ID can also be an array of widget identifiers, in which case the result is an array with the same structure in which information on all the specified widgets is returned.
Not all keywords to WIDGET_INFO apply to all combinations of widgets. In the following list, descriptions of keywords that affect only certain types of widgets include a list of the widgets for which the keyword is useful.
This keyword applies to all widgets.
Set this keyword to return 1 if there is at least one realized, managed, top-level widget on the screen. Otherwise, 0 is returned.
This keyword applies to all widgets.
Set this keyword to return the widget ID of the first child of the widget specified by Widget_ID . If the widget has no children, 0 is returned.
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to return an array of long integers giving the width of each column in the table. If USE_TABLE_SELECT is set, only the column widths for the currently-selected cells are returned.
This keyword applies to widgets created with the WIDGET_DRAW function.
Set this keyword to return 1 if Widget_ID is a draw widget with the BUTTON_EVENTS attribute set. Otherwise, 0 is returned.
This keyword applies to widgets created with the WIDGET_DRAW function.
Set this keyword to return 1 if Widget_ID is a draw widget with the EXPOSE_EVENTS attribute set. Otherwise, 0 is returned.
This keyword applies to widgets created with the WIDGET_DRAW function.
Set this keyword to return 1 if Widget_ID is a draw widget with the MOTION_EVENTS attribute set. Otherwise, 0 is returned.
This keyword applies to widgets created with the WIDGET_DRAW function.
Set this keyword to return 1 if Widget_ID is a draw widget with the VIEWPORT_EVENTS attribute set. Otherwise, 0 is returned.
This keyword applies to widgets created with the WIDGET_DROPLIST function.
Set this keyword to return the number of elements currently contained in the specified droplist widget.
This keyword applies to widgets created with the WIDGET_DROPLIST function.
Set this keyword to return the zero-based number of the currently-selected element (i.e., the currently-displayed element) in the specified droplist widget.
This keyword applies to widgets created with the WIDGET_BUTTON , WIDGET_DROPLIST , and WIDGET_LABEL functions.
Set this keyword to return a True value (1) if the widget specified by Widget_ID is a button, droplist, or label widget that has had its DYNAMIC_RESIZE attribute set. Otherwise, False (0) is returned.
This keyword applies to all widgets.
Set this keyword to return a string containing the name of the event handler function associated with Widget_ID . A null string is returned if no event handler function exists.
This keyword applies to all widgets.
Set this keyword to return a string containing the name of the event handler procedure associated with Widget_ID . A null string is returned if no event handler procedure exists.
This keyword applies to all widgets.
Set this keyword to return a WIDGET_GEOMETRY structure that describes the offset and size information for the widget specified by Widget_ID . This structure has the following definition:
With the exception of MARGIN, all of the structure's fields correspond to the keywords of the same name to the various widget routines. MARGIN is the width of any frame added to the widget, in units specified by the UNITS keyword (pixels are the default). Therefore, the actual width of any widget is:
The actual height of any widget is:
Note also that if the top-level base includes a menubar, it is not possible to determine the actual height of the base widget. Calling WIDGET_INFO with the GEOMETRY keyword on a top level base that includes a menubar will return a geometry structure that contains zeroes rather than the actual sizes of the widget.
NOTE: Menubars are not included in the size of a top-level base, so the actual height of a widget that includes a menubar is:
SCR_YSIZE + (2 * MARGIN) + menubar height
It is not possible to either determine or change the height of a menubar within IDL. Retrieving the WIDGET_GEOMETRY structure of a menubar yields a structure with all the fields set equal to zero.
This keyword applies to all widgets.
Set this keyword to return the keyboard focus events status of the widget specified by Widget ID . WIDGET_INFO returns 1 (one) if keyboard focus events are currently enabled for the widget, or 0 (zero) if they are not. Only base, table, and text widgets can generate keyboard focus events.
This keyword applies to widgets created with the WIDGET_LIST function.
Set this keyword equal to a named variable that will contain a non-zero value if the list widget supports multiple item selections. See the MULTIPLE keyword to WIDGET_LIST for more on multiple item selections.
This keyword applies to widgets created with the WIDGET_LIST function.
Set this keyword to return the number of elements currently contained in the specified list widget.
This keyword applies to widgets created with the WIDGET_LIST function.
Set this keyword to return the number of elements that can be visible in the scrolling viewport of the specified list widget. Note that this value can be larger than the total number of elements actually in the list.
This keyword applies to widgets created with the WIDGET_LIST function.
Set this keyword to return the index or indices of the currently-selected (highlighted) element or elements in the specified list widget. Note that this offset is zero-based. If no element is currently selected, -1 is returned.
This keyword applies to widgets created with the WIDGET_LIST function.
Set this keyword to return the zero-based offset of the topmost element currently visible in the specified list widget.
This keyword applies to all widgets.
Set this keyword equal to a named variable. If a single widget ID is specified in the call to WIDGET_INFO, the variable will contain a True (1) value if the specified widget is managed, or False (0) otherwise. If no widget ID is specified in the call to WIDGET_INFO, the variable will contain an array containing the widget IDs of all currently-managed widgets.
This keyword applies to widgets created with the WIDGET_BASE function and the MODAL keyword.
If this keyword is set, WIDGET_INFO will return True (1) if the base widget specified by Widget_ID is a modal base widget, or False (0) otherwise.
This keyword applies to all widgets.
Set this keyword to return the widget type name of the widget specified by Widget_ID . The returned value will be one of the following strings: "BASE", "BUTTON", "DRAW", "DROPLIST", "LABEL", "LIST", "SLIDER", "TABLE", or "TEXT". Set the TYPE keyword to return the widget's type code.
This keyword applies to all widgets.
Set this keyword to return the widget ID of the parent of the widget specified by Widget_ID . If the widget is a top-level base (i.e., it has no parent), 0 is returned.
This keyword applies to all widgets.
Set this keyword to return 1 if the widget specified by Widget_ID has been realized. If the widget has not been realized, 0 is returned.
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to return an array of long integers giving the height of each row in the table. If USE_TABLE_SELECT is set, only the row heights for the currently-selected cells are returned.
This keyword applies to all widgets.
Set this keyword to return the widget ID of the first sibling of the widget specified by Widget_ID . If the widget is the last sibling in the chain, 0 is returned.
This keyword applies to widgets created with the WIDGET_SLIDER function.
Set this keyword to return the current minimum and maximum values of the specified slider as a two-element integer array. Element 0 is the minimum value and element 1 is the maximum value.
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to return 1 (one) if Widget_ID is a table widget with the ALL_EVENTS attribute set. Otherwise, 0 (zero) is returned.
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to return 1 (one) if Widget_ID is a table widget that allows user editing of its contents. Otherwise, 0 (zero) is returned.
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to return a two-element integer array containing the X and Y coordinates of the currently editable cell. If none of the cells in the table widget is currently editable, the array [-1, -1] is returned.
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to return an array of the form [ left , top , right , bottom ] containing the zero-based indices of the currently-selected (highlighted) cells in the specified table widget.
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to return a two-element array of the form [ left , top ] containing the zero-based offsets of the top-left cell currently visible in the specified table widget.
This keyword applies to widgets created with the WIDGET_TEXT function.
Set this keyword to return 1 if Widget_ID is a text widget with the ALL_EVENTS attribute set. Otherwise, 0 is returned.
This keyword applies to widgets created with the WIDGET_TEXT function.
Set this keyword to return 1 if Widget_ID is a text widget that allows user editing of its contents. Otherwise, 0 is returned.
This keyword applies to widgets created with the WIDGET_TEXT function.
Set this keyword to return the number of characters currently contained in the specified text widget.
This keyword applies to widgets created with the WIDGET_TEXT function.
Use this keyword to translate a text widget character offset into column and line form. The value of this keyword should be set to the character offset (an integer) to be translated. WIDGET_INFO returns a two-element integer array giving the column (element 0) and line (element 1) corresponding to the offset. If the offset specified is out of range, the array [-1,-1] is returned.
This keyword applies to widgets created with the WIDGET_TEXT function.
Set this keyword to return the starting character offset and length (in characters) of the selected (highlighted) text in the specified text widget. WIDGET_INFO returns a two-element integer array containing the starting position of the highlighted text as an offset from character zero of the text in the widget (element 0), and length of the current selection (element 1).
This keyword applies to widgets created with the WIDGET_TEXT function.
Set this keyword to return the zero-based line number of the line currently at the top of a text widget's display viewport. Note that this value is different from the zero-based character offset of the characters in the line. The character offset can be calculated from the line offset via the TEXT_XY_TO_OFFSET keyword.
This keyword applies to widgets created with the WIDGET_TEXT function.
Use this keyword to translate a text widget position given in line and column form into a character offset. The value of this keyword should be set to a two-element integer array specifying the column (element 0) and line (element 1) position. WIDGET_INFO returns the character offset (as a longword integer) corresponding to the position. If the position specified is out of range, -1 is returned.
This keyword applies to widgets created with the WIDGET_BASE function.
Set this keyword to return 1 if the top-level base of the widget specified by Widget_ID is set to return kill request events. Otherwise, 0 is returned.
This keyword applies to all widgets.
Set his keyword to return the tracking events status for the widget specified by Widget_ID . WIDGET_INFO returns 1 if tracking events are currently enabled for the widget. Otherwise, 0 is returned.
This keyword applies to all widgets.
Set this keyword to return the type code of the specified Widget_ID . Possible values are given in Widget Type Codes . Note that you can set the NAME keyword to return string names instead.
This keyword applies to all widgets.
Use this keyword to specify the unit of measurement used when returning dimensions for most widget types. Set UNITS equal to 0 (zero) to specify that all measurements are in pixels (this is the default), to 1 (one) to specify that all measurements are in inches, or to 2 (two) to specify that all measurements are in centimeters.
NOTE: This keyword does not affect all sizing operations. Specifically, the value of UNITS is ignored when retrieving the XSIZE or YSIZE of a WIDGET_LIST , WIDGET_TABLE , or WIDGET_TEXT .
This keyword applies to all widgets.
Set this keyword to return 1 if the widget hierarchy that contains Widget_ID is set to display updates. Otherwise, 0 is returned. See UPDATE .
This keyword applies to widgets created with the WIDGET_TABLE function.
Set this keyword to modify the behavior of the COLUMN_WIDTHS and ROW_HEIGHTS keywords. If USE_TABLE_SELECT is set, the COLUMN_WIDTHS and ROW_HEIGHTS keywords only apply to the currently-selected cells. Normally, these keywords apply to the entire contents of a table widget.
The USE_TABLE_SELECT keyword can also be specified as a four-element array, of the form [left, top, right, bottom], giving the group of cells to act on. In this usage, the value -1 is used to refer to the row or column titles.
This keyword applies to all widgets.
Set this keyword to return 1 if Widget_ID represents a currently-valid widget. Otherwise, 0 is returned.
This keyword applies to all widgets.
Set this keyword to return a structure that gives information about the widget implementation. This structure has the following definition:
{ WIDGET_VERSION, STYLE:'', TOOLKIT:'', RELEASE:'' }
STYLE
is the style of widget toolkit used.
TOOLKIT
is the implementation of the toolkit.
RELEASE
is the version level of the toolkit. This field can be used to distinguish between different releases of a given toolkit, such as Motif 1.0 and Motif 1.1.
Widgets .