Reference Guide > W Routines > WtGet Function
  

WtGet Function
Retrieves widget resources.
Usage
value = WtGet(widget[, resource])
Parameters
widget — The widget ID.
resource — (optional, Motif only) A string containing the name of the requested resource. This parameter is GUI-dependent. See the Discussion section for more information.
Returned Value
value — A variable in which the value of the resource is returned. The data type of value depends on the requested resource.
Keywords
Child=child — (Motif only) Returns the ID of the child widget in a composite widget, such as a Command or FileSelection widget:
Legal values for a Command widget:
*XmDIALOG_COMMAND_TEXT
*XmDIALOG_PROMPT_LABEL
*XmDIALOG_HISTORY_LIST
Legal values for a FileSelection widget:
*XmDIALOG_APPLY_BUTTON
*XmDIALOG_CANCEL_BUTTON
*XmDIALOG_DEFAULT_BUTTON
*XmDIALOG_DIR_LIST
*XmDIALOG_DIR_LIST_LABEL
*XmDIALOG_FILTER_LABEL
*XmDIALOG_FILTER_TEXT
*XmDIALOG_HELP_BUTTON
*XmDIALOG_LIST
*XmDIALOG_LIST_LABEL
*XmDIALOG_OK_BUTTON
*XmDIALOG_SELECTION_LABEL
*XmDIALOG_SEPARATOR
*XmDIALOG_TEXT
*XmDIALOG_WORK_AREA
For a MessageBox widget:
*XmDIALOG_CANCEL_BUTTON
*XmDIALOG_DEFAULT_BUTTON
*XmDIALOG_HELP_BUTTON
*XmDIALOG_MESSAGE_LABEL
*XmDIALOG_OK_BUTTON
*XmDIALOG_SEPARATOR
*XmDIALOG_SYMBOL_LABEL
For a SelectionBox widget:
*XmDIALOG_APPLY_BUTTON
*XmDIALOG_CANCEL_BUTTON
*XmDIALOG_DEFAULT_BUTTON
*XmDIALOG_HELP_BUTTON
*XmDIALOG_LIST
*XmDIALOG_LIST_LABEL
*XmDIALOG_OK_BUTTON
*XmDIALOG_SELECTION_LABEL
*XmDIALOG_SEPARATOR
*XmDIALOG_TEXT
*XmDIALOG_WORK_AREA
Child — Returns a long integer array of child widget IDs.
Class — Returns the widget class for the given widget.
Count=count — Specifies the number of items for resources containing an array of strings, such as a list or command.
Destroyed — Returns 1 if the given widget is in the process of being destroyed; 0 otherwise.
Managed — Returns 1 if the given widget is managed; returns 0 if the widget is unmanaged.
MultiClick — Returns the time, in milliseconds, that is used to determine if consecutive mouse button clicks are to be interpreted as multiple clicks.
Name — Returns the name of the given widget.
Name=name — Returns the ID of the named widget and its parent.
Ncols — Specifies the number of columns of the two-dimensional resource to be retrieved. A two-dimensional resource is a resource whose value is a two-dimensional array of strings. Currently, two-dimensional resources are used in the table widget.
Nrows — Specifies the number of rows of the two-dimensional resource to be retrieved.
Parent — Returns the widget ID of the parent of the given widget.
Realized — Returns 1 if the given widget is realized (displayed); returns 0 if it is unrealized.
Sensitive — Returns 1 if the given widget is sensitive; returns 0 if it is not sensitive.
Shell — Returns 1 if the given widget is a shell (top-level widget); returns 0 if it is not a shell.
Userdata — Returns the user data (any variable or structure) for the given widget formally stored by the WtSet function.
Value — Returns the value for a scale, scroll bar, or toggle button.
Widget — Returns 1 if the given widget is a widget (not a shell); returns 0 if it is not a widget.
Window — Returns the window ID of the given widget.
Window=window — Returns the widget ID of the given window.
Discussion
Motif developers, see the OSF/Motif Programmer’s Reference for a list of resource names.
 
note
Rogue Wave has ported a subset of the Widget Toolbox (Wt) functionality that is available for Motif to Microsoft Windows. Because the Widget Toolbox under Windows is not a complete implementation, we recommend that Windows developers use the PV‑WAVE Widgets (Ww) layer or the VDA Tools when developing GUI applications.
The WtGet keywords are supported for Windows; however, the use of the resource parameter to pass resource names is not supported.
The resource name for a Widget Toolbox widget is derived from the Motif widget set resource name. Remove the XmN prefix from the Motif resource name. For example the Motif resource name XmNwidth becomes width.
The data type of a resource’s value depends on the type of the resource.
Example
; Returns the window ID of the specified widget (wid).
window = WtGet(wid, /Window)
; Returns the widget ID of window win(2) for the specified 
; widget (wid).
wid = WtGet(wid, Window=win(2))
; Returns 1 if given widget is not a shell, or 0 if it is a shell.
widget = WtGet(wid, /Widget)
; Returns the name of the specified widget (wid).
name = WtGet(wid, /Name)
; Returns the ID of the XMDIALOG_DIR_LIST component of the
; FileSelection widget (wid).
child = WtGet(wid, Child=XmDIALOG_DIR_LIST)
See Also
For detailed information on GUI development, refer to the PV‑WAVE Application Developer’s Guide.
For more information about how to write an application program based on the PV‑WAVE Widget Toolbox, refer to Using the Widget Toolbox in the PV‑WAVE Application Developer’s Guide.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.