XmNmnemonic = keysym ('A');
XmNaccelerator = 'Ctrl<Key>A';
XmNacceleratorText = "Ctrl+A";
};
callbacks {
XmNactivateCallback = procedure search_cb (SEARCH_SHOW_ALL);
};
};
object replace : XmPushButton {
arguments {
XmNlabelString = "Replace Text";
XmNmnemonic = keysym ('R');
};
callbacks {
XmNactivateCallback = procedure search_cb (SEARCH_REPLACE);
};
};
object sclear : XmPushButton {
arguments {
XmNlabelString = "Clear";
XmNmnemonic = keysym ('C');
};
callbacks {
XmNactivateCallback = procedure search_cb (SEARCH_CLEAR);
};
};
end module;
We set the objects option at the beginning of this module so that all of the menu entries are created as gadgets.
Setting this option at the top of the module saves you from accidentally forgetting to use the gadget version of one of
the buttons in a widget definition. Even though our menus do not include Labels or ToggleButtons, these objects are
included in the option setting in case we decide to add some later.
Once again, the widget definitions in this module are organized in a top−down manner. The first widget definition is
the MenuBar, which contains a CascadeButton for each menu. In UIL, you declare the PulldownMenu associated with
a CascadeButton as a child of the button, instead of as a child of the MenuBar, like in C code. The UIL method is
more intuitive. At run−time, Mrm creates each menu as a child of the MenuBar and sets the XmNsubMenuId
resource of the appropriate CascadeButton to satisfy the Motif requirements.
For each menu, we define ...