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 ...