SCO Visual Tcl Reference Guide
Chapter 3, SCO Visual Tcl - graphical scripting language

Object class options

Object class options

The following options govern the general attributes of objects.

-allowDuplicateName (C)
Creates objects with duplicated names. Use this option only if you do not intend to reference the object. A typical use of this option could be in a menu routine where references to the separators are not needed. Referencing an object with duplicated names is undefined and not supported.

-autoLock list of callback procedure names (C)
Locks the server process before calling a callback. The server will lock itself (that is, not accept any more input) before calling any of the callbacks specified in the list. The lock is exactly the same as calling VtLock(VTCL). The programmer must remember to unlock the application by calling VtUnLock(VTCL).

For example:

proc lockCB {cbs} {
    sleep 5
set ap [VtOpen Lock]
set dlog [VtFormDialog $ap.form ]
VtPushButton $dlog.Lock  -callback lockCB -autoLock lockCB
VtShow $dlog
autoLock is typically used in cases where you are changing the current form and you do not want the user to be able to access the form while those changes are being made (for example, if you are stippling fields in the current form).

Sets the background color of the widget to one of the symbolic color names defined in the SCO Visual Tcl application resource file. Pre-defined symbols are:

-baseLineList (G)
Gets the list of baselines for a widget. In character mode this always returns 0. The baseline is the distance from the top of the widget to the baseline of the font for the text within the widget.

-borderWidth integer (CS)
Sets the width of the border in pixels. In character mode, if the borderWidth is 0 the border is turned off, if 1 the border is single-lined, if > 1 then the border is double-lined.

-errorCallback cmd (C)
Sets command cmd as the handler to be called when an error occurs in a callback. When an error occurs SCO Visual Tcl will go up the object tree until it finds an error callback to handle the error.

Additional callback keys:

Tcl return string

Callback that encountered the error

Tcl return code)

-font string (CS)
Sets the fontList of an object to symbolic font names defined in the SCO Visual Tcl application resource file. Pre-defined symbols are:













For example: VtPushButton $parent.button -font largePlainFont

Sets the foreground color of the widget to one of the symbolic color names defined in the SCO Visual Tcl application resource file. Pre-defined symbols are:

-height integer (CS)
Sets the height of the object. In graphical mode, integer is the height in pixels. In character mode, integer sets the height of the object in character units. The widget must be ``managed'' before this value can be retrieved with VtGetValues(VTCL). (If the object has -rows as an option, this may be a more convenient way of setting its height.)

-helpCallback cmd (C)
Sets the help callback for an object. This callback is called when the <F1> keypress is received by the object. The callback structure returns a keyed list.

Additional callback keys:

Widget Tree token (used by help system)

-hidden boolean (C)
Specifies whether the object is displayed or not displayed after creation. By default, all non-dialog objects are displayed when created.

-sensitive boolean (CSG)
Determines whether the widget receives input events. If set to False, the widget will be grayed and will not accept events. The default is True.

-shortHelpCallback cmd (CS)
Sets the cmd to call when the mouse button enters or leaves a widget.

Additional callback keys:

shortHelpString set for the widget.

-shortHelpString string (CS)
Sets the string that is sent to the short help callback.

-width integer (CSG)
In the graphical environment this sets the width of the widget in pixels. In character mode it sets the width in characters. The widget must be ``managed'' before this value can be obtained by VtGetValues(VTCL).

-userData string (CS)
Sets any string that you want to attach to any widget. (This is typically used to attach comment information to widgets that can be retrieved later using VtGetValues.)

See also: VxSetVar(VTCL) and VxGetVar(VTCL).

-xmArgs list_of_string_pairs (CS)
This is a ``back end'' routine for setting OSF/Motif resources that have not been implemented. The OSF/Motif resources specified with xmArgs are passed to the widget creation and manipulation commands, as described in the Motif Reference Manual. For example, this changes the background of the button to blue and the foreground to red:
VtPushButton $fn.but \
-xmArgs {XmNbackground blue \
XmNforeground red}
See also: ``Geometry class options''