Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431