WwGetValue Function

Returns a specific value for a given widget.

Usage

value = WwGetValue(widget)

Input Parameters

widget — The widget for which you want the value.

Returned Value

value — The value returned from the widget.

Keywords

Children — If nonzero, returns the widget IDs of the children of the widget specified by the widget parameter.

Class — If nonzero, returns the widget class of the widget specified by the widget parameter.

Destroyed — Returns 1 if the given widget is in the process of being destroyed; 0 otherwise.

Exists — If nonzero, returns 1 if widget exists, 0 if not.

Note:

The output from the Exists keyword depends on the system's underlying X11 implementation and has been found to be unreliable, leading users to attempt to access non-existent widgets. Exists is maintained strictly for backwards compatibility and should not be used.

Parent — If nonzero, returns the widget ID of the parent of the widget specified by the widget parameter.

Position — Returns the position of the widget as a 2-element array: [x, y], where x and y are a number of pixels.

Sensitive — Returns 1 if widget is sensitive, or 0 if widget is not sensitive.

Shown — Returns 1 if the widget is shown, or 0 if the widget is not visible.

Size — Returns the width and height of the widget as a 2-element array: [w, h] , where w and h are a number of pixels.

Note:

On shell widgets, the result of this keyword is always 1. This is because the Xt Intrinsics functions XtPopdown() and XtPopup() are used to hide or show shell widgets, and it is not possible to determine whether a shell has been popped down or not.

Userdata — Returns the value of the Userdata variable that was previously stored with the WwSetValue function.

Discussion

See the Get Value section under each PV‑WAVE Widget function description to find out what WwGetValue returns by default for each function. For example, WwGetValue called with the ID of a list widget returns a string array containing the selected items in the list.

Example

The following example demonstrates WwGetValue with the WwCommand function. WwGetValue returns a string array containing the commands entered in the Command window. The callback routine CommandOK prints the value returned by WwGetValue whenever the user enters a command in the Command window and presses <Return>.

Enter the callback procedures into a file, and compile the procedure with the .RUN command. Then, enter the widget commands at the WAVE> prompt. To dismiss the widget, select the appropriate function (such as Close) from the window manager menu of the command window.

Callback Procedures

PRO CbuttonCB, wid, data
   command = WwCommand(wid, 'CommandOK', 'CommandDone', $
   Position=[300,300], Title='Command Entry Window')
END
PRO CommandOK, wid, shell
   value = WwGetValue(wid)
   print, value
END
PRO CommandDone, wid, shell
   status = WwSetValue(shell, /Close)
END

Widget Commands

top=WwInit('ww_ex26', 'Examples', layout)
button=WwButtonBox(layout, 'Command', 'CbuttonCB')
status=WwSetValue(top, /Display)
WwLoop

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 PV‑WAVE Widgets, refer to Using Wave Widgets in the PV‑WAVE Application Developer’s Guide.