Menu titles should not be dynamically created or destroyed. An application should not make the MenuBar disappear
or add new titles to the MenuBar while the application is running. All of the titles in the MenuBar must be available to
the user when the MainWindow is visible. You can, however, deactivate an entire menu by changing the
XmNsensitive resource on the CascadeButton widget that acts as its title, as discussed in Section #smenusens.
16.3.2 Menu Items
The items in a menu are actually the labels of the PushButtons that make up the menu. Unlike the File title item in the
MenuBar, we chose not to use hard−coded values for the menu item strings, so the strings can be set in a resource file.
While our menu only contains PushButton gadgets, a PulldownMenu can also contain ToggleButtons, Separators, and
CascadeButtons.
You can install a callback routine for each of the items in a menu, or you can install an XmN-entryCallback for
the RowColumn widget to act on behalf of all the menu items. This resource specifies a callback function that
overrides the XmNactivateCallback used by Pushbuttons and the XmNvalueChangedCallback used by
ToggleButtons. Using this resource generates a design that is similar to the simple menu routines described earlier.
See Chapter 8, Manager Widgets, for details on this generic RowColumn resource.
As with the title items, menu items should not be dynamically created or destroyed since it may confuse the user.
However, there is one exception to this guideline. If a ...