WoLabeledText Function

Creates a group of aligned text widgets (widgets with a label and a text field).

Usage

widget = WoLabeledText(parent, label_names, verify_callback)

Input Parameters

parent — Specifies the parent widget ID of the text widget (long).

label_names — Specifies an array of strings containing the names of the label widgets.

verify_callback — Specifies a string containing the name of the text verification callback.

Returned Value

widget — The widget ID of the container widget (long).

Input Keywords

Cols — Specifies the number of columns in the text widgets. (Default: 10)

Horizontal — If nonzero, aligns the text widgets horizontally. (Default: vertical alignment)

Layout_Name — Specifies a string containing the name of the container widget.

Position — A two-element array specifying the x, y coordinates of the text widgets in the bulletin board. (Default: [0,0])

Text_Names — Specifies a string array containing the names of the text widgets. (Default: ['text_0', 'text_1', ...])

Text_Strings — Specifies a string array containing the initial contents of the text widgets.

Output Keywords

Text_Widgets — An array of widget IDs for the text widgets.

Attachment Keywords

Bottom — If a widget ID is specified (for example, Bottom=wid), then the bottom of the text widget is attached to the top of the specified widget. If no widget ID is specified (for example, /Bottom), then the bottom of the text widget is attached to the bottom of the parent widget.

Left — If a widget ID is specified (for example, Left=wid), then the left side of the text widget is attached to the right side of the specified widget. If no widget ID is specified (for example, /Left), then the left side of the text widget is attached to the left side of the parent widget.

Right — If a widget ID is specified (for example, Right=wid), then the right side of the text widget is attached to the left side of the specified widget. If no widget ID is specified (for example, /Right), then the right side of the text widget is attached to the right side of the parent widget.

Top — If a widget ID is specified (for example, Top=wid), then the top of the text widget is attached to the bottom of the specified widget. If no widget ID is specified (for example, /Top), then the top of the text widget is attached to the top of the parent widget.

Discussion

The number of text fields is determined by the number of elements in the label_names parameter.

The text fields are vertically-aligned unless Horizontal is specified.

Example

This example creates a group of vertically aligned text widgets. The text field labels can be obtained from a resource file.

PRO ValueChangedCB, wid, which
   ...
   ; This callback is called if user types <Return> within one 
   ; of the text widgets. The value will be a PV-WAVE string, 
   ; identical to the value returned from WwText.
   value = WwGetValue (wid)
   print, value
   ...
END
PRO CreateStuff
   ...
   top = WwInit ('example', 'Example', layout)
   ; Create a group of vertically aligned text widgets. The label
   ; strings will be blank unless they are loaded from a resource 
   ; file or the X resource database. The label strings should 
   ; be specified in resources, such as:
      *distance.labelString: Distance
      *velocity.labelString: Velocity
      *acceleration.labelString: Acceleration
   textWids = WoLabeledText (layout, ['distance', 'velocity', $
      'acceleration'], 'ValueChangedCB')
   ...
   status = WwSetValue (top, /Display)
   WwLoop
END

See Also

WwInit