
Output of dynapix.c
The beginning of the program is pretty much as expected. After the toolkit is initialized, the MainWindow and the
MenuBar are created the same way as in the previous examples. Just after the MenuBar is created, however, we make
the following calls:
if (widget = XtNameToWidget (menubar, "button_2"))
XtVaSetValues(menubar, XmNmenuHelpWidget, widget, NULL);
The purpose of these statements is to inform the MenuBar which of its CascadeButtons contains the Help menu.
Setting the MenuBar's XmNmenuHelpWidget resource to the CascadeButton returned by XtNameToWidget()
causes the MenuBar to position the menu specially. The Help menu is placed at the far right on the MenuBar; this
position is necessary for the application to conform to Motif sytle guidelines. For details on how to support a help
system, see Chapter 7, Custom Dialogs, and Chapter 21, Advanced Dialog Programming.
PulldownMenus are created next in the expected manner. The only variation is for the Edit menu, where each item in
the menu represents a color. Since only one color can be used at a time, the color that is currently being used is
marked with a diamond−shape indicator. In order to get this radio−box behavior, each menu item in the
PulldownMenu is a XmVaRADIOBUTTON and the menu is told to treat the items as a RadioBox. The analogy is that
of an old car radio, where selecting a new station causes the other selectors ...