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
NULL. The tear−off button has a Separator−like appearance; you can specify its background, foreground, and top and
bottom shadow colors using the standard resources, as well as the XmNseparatorType resource. You can also set
these resources in a resource file using the name of the button, which is TearOffControl.
16.4 General Menu Creation Techniques
Now we have addressed each of the fundamental elements of the MenuBar and the resources used to provide the user
with the appropriate feedback. Using this information, we can generalize the way we build MenuBars, enabling us to
create arbitrarily large MenuBars and PulldownMenus using a substantially smaller amount of code.
In the examples that follow, we use many of the recommended elements for a standard Motif MenuBar. You can
adjust the algorithms and data structures to fit the needs of your own application. Although we use hard−coded values
for widget resources, this technique is by no means a requirement, nor should it be construed as recommended usage.
If you choose to specify resources in a resource file, you should write an application defaults file that contains the
appropriate resource values.
16.4.1 Building Pulldown Menus
Let's begin by identifying each of the attributes of a menu item:
Label
Mnemonic
Accelerator
Accelerator text
Callback routine
Callback data
Using this information, we can construct a data structure that describes all of the important aspects of a menu item.
We define the MenuItem structure as follows:
typedef ...
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