For a more complete description of this Motif widget, consult "OSF/Motif Programmer's Reference."
command_entered_action is an action that is executed when the return key is pressed or when the mouse is double-clicked on an item.
command_changed_action is an action that is executed when any change is made to the text edit widget, when the return key is pressed, when the up ro down arrow is pressed, or when the mouse is double-clicked on an item. mouse event.
resize_action is an action that is executed when the widget is resized.
: value sets the current resource to value. Since most resources have mixed case, you should enclose any resource name in quotes. Resource names are the Motif names with the XmN prefix removed. Some resources can only be set before the widget is created. For efficiency, set as many resources as you can before creation.
scalar_value? returns the value of the current resource whose type is integer.
string_value? returns the value of the current resource whose type is string.
pointer_value? returns the value of the current resource whose type is a pointer of any kind.
create! creates an instance of the widget. Any resources that have been specified prior to the create! will be set. An id? message also sends a create!.
on! realizes the widget. Realizing a widget creates its windows and displays it when it is managed.
command= arg sets the command to arg. If the widget underlying the object has not yet been created, a create! message is sent. Be aware that all actions and some resources must be set before widget creation.
<motifinit <colors
motif application="Command Widget Example";
motif_command new: aCommand parent=motif @ "promptString" : "Enter any Lymb statement" @ width : 256 command_entered_action=`entered' focus_action=`generic' create! ;
procedure new: `generic' in_formals=(`widget', `action') call_actions=` string new: `s' = `! ' + action + ` in ' + widget ; parser parse: s; ' ;
procedure new: entered in_formals=(`widget', `action', `event') call_actions=` msg enable_globals!; object # widget print:`command'; parser parse: [object # widget command?]; ' ;
motif on!; motif start!;