names+ (name1,name2,...) Adds the arguments to the list of names for which aliases will be generated.
names- (name1,name2,...) Removes the arguments from the list of names for which aliases will be generated.
names? Returns all names stored in the top stack frame.
generate_aliases! generates aliases for all active names.
aliases? returns all aliases for the names in the top stack frame.
push! opens a new level of alias expansion.
pop! closes the current level of alias expansion, releasing all name/alias pairs for the current level.
/* define aliases for the various objects we will be creating */ alias_generator push! names=(`form', `up', `down', `label', `up_actions', `down_actions') generate_aliases! ; parser expand_aliases_on!;
alias_generator print:aliases;
/* create the objects, aliasing along the way */ motif_form_dialog new: `form' parent=`motif' create! ;
motif_arrow_button new: `up' parent=`form' @ `arrowDirection' : XmARROW_UP @ `topAttachment' : XmATTACH_FORM @ `leftAttachment' : XmATTACH_FORM @ `rightAttachment' : XmATTACH_FORM create! ;
motif_label new: `label' parent=`form' @ `topAttachment' : XmATTACH_WIDGET @ `topWidget' : [up id?] @ `leftAttachment' : XmATTACH_FORM @ `rightAttachment' : XmATTACH_FORM create! ;
motif_arrow_button new: `down' parent=`form' @ `arrowDirection' : XmARROW_DOWN @ `topAttachment' : XmATTACH_WIDGET @ `topWidget' : [label id?] @ `leftAttachment' : XmATTACH_FORM @ `rightAttachment' : XmATTACH_FORM create! ;
actions new: `up_actions' tick_actions=` up print!; ' ;
actions new: `down_actions' tick_actions=` down print!; '
;
/* action compilation is required to expand object names
within tick actions */ up_actions compile!; down_actions compile!;
/* disable alias expansion and get rid of the current
crop of aliases */ parser expand_aliases_off!; alias_generator pop!;