: 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.
<motifinit
motif application="Form Example";
motif_push_button new: formButton parent=motif @ "labelString" : "Push to Pop up a Form" activate_action=popup_form create! ; actions new: popup_form tick_actions+ "formshell on!;" tick_actions+ " formButton @ `labelString' : `Push to remove form' activate_action=popdown_form; " ; actions new: popdown_form tick_actions+ "formshell off!;" tick_actions+ " formButton @ `labelString' : `Push to Pop up a FormDialog' activate_action=popup_form; " ;
motif_top_level_shell new: formshell parent=motif @ `title' : `Sample Form' create! ;
motif_form new: aForm parent=formshell @ "width" : 200 @ "height" : 200 create! ; motif_push_button new: upper_left parent=aForm @ "topAttachment" : XmATTACH_FORM @ "leftAttachment" : XmATTACH_FORM @ "labelString" : "Upper Left" activate_action=popon create! ; motif_error_dialog new: error parent=motif @ "messageString" : "OH NO!!!" create! ;
actions new: popon tick_actions="error on!;"; motif_push_button new: upper_right parent=aForm
@ "topAttachment" : XmATTACH_FORM @ "rightAttachment" : XmATTACH_FORM @ "labelString" : "Upper Right" create! ; motif_push_button new: lower_right parent=aForm @ "bottomAttachment" : XmATTACH_FORM @ "rightAttachment" : XmATTACH_FORM @ "labelString" : "Lower Right" create! ; motif_push_button new: lower_left parent=aForm @ "bottomAttachment" : XmATTACH_FORM @ "leftAttachment" : XmATTACH_FORM @ "labelString" : "Lower Left" create! ; motif_push_button new: middle parent=aForm @ "bottomAttachment" : XmATTACH_WIDGET @ "topAttachment" : XmATTACH_WIDGET @ "leftAttachment" : XmATTACH_WIDGET @ "rightAttachment" : XmATTACH_WIDGET @ "rightWidget" : [upper_right id?] @ "leftWidget" : [upper_left id?] @ "topWidget" : [upper_left id?] @ "bottomWidget" : [lower_left id?] @ "labelString" : "Middle" create! ; motif on! start!;