Next | Prev | Up | Top | Contents | Index

xmCommand

A command widget is composed of a history area (an xmScrolledList), a label to display the prompt, and a text field to edit the current command. The command widget is a subclass of xmSelectionBox. You may add an extra child, called the work area.

The command widget recognizes several new methods:

cw appendValue command


Append to the string already in the text field. The string is truncated before the first newline encountered.

cw error error_message


Temporarily display the error_message at the bottom of the history area. It automatically disappears when the user enters another command.

cw setValue command


Replace the string in the text field by command. The old command is not entered in the history.
Table 4-45 lists the resources associated with xmCommand.

xmCommand Resources
Resource NameDefault ValueType or Legal Values
-command""String
-historyItems""String Table
-historyItemCount0Integer
-historyMaxItems100Integer
-historyVisibleItemCount8Integer
-promptString">"String

Other resources are inherited xmSelectionBox and its ancestors.

Table 4-46 lists the callbacks associated with xmCommand.

xmCommand Callbacks
Method Name Why
commandChangedCallback The current command changed (the user typed something).
commandEnteredCallback The command was entered before the <Enter> key.

Both of these callbacks support the %value and %length substitution, which are replaced by the string (or string length) that fired the callback.


Next | Prev | Up | Top | Contents | Index