|
NAMEXmtMenuGetMenuItem(), XmtMenuItemGetSubmenu(), XmtMenuItemGetWidget(), XmtMenuItemSetSensitivity(), XmtMenuItemGetState(), XmtMenuItemSetState() - look up items in an XmtMenu widget by name, and manipulate them.SYNOPSIS#include <Xmt/Menu.h>
XmtMenuItem *XmtMenuGetMenuItem(Widget w, String name) Widget XmtMenuItemGetSubmenu(XmtMenuItem *item) Widget XmtMenuItemGetWidget(XmtMenuItem *item) void XmtMenuItemSetSensitivity(XmtMenuItem *item, Boolean sensitive) Boolean XmtMenuItemGetState(XmtMenuItem *item) void XmtMenuItemSetState(XmtMenuItem *item, Boolean state, Boolean notify) ARGUMENTSINPUTS
RETURNS XmtMenuGetMenuItem() returns the named menu item, or NULL if it could not be found. XmtMenuItemGetSubmenu() returns the XmtMenu widget that is associated with the specified cascade button menu item. XmtMenuItemGetWidget() returns the widget associated with the specified menu item. XmtMenuItemGetState() returns True if the specified toggle button menu item is selected an False if it is unselected. DESCRIPTIONThe items in an XmtMenu widget are described by XmtMenuItem structures. If you specify your menu in C code, then you will declare and initialize these structures explicitly. If you specify your menu in a resource file, you can use XmtMenuGetMenuItem() to look up the XmtMenuItem structure of a named item. The other functions described here perform various manipulations on a specified menu item.XmtMenuGetMenuItem() searches for and returns the menu item named name in the XmtMenu widget w, and also recursively searches any pulldown and pullright menus attached to w. You can specify a name for a menu item created in C code by setting the name field of the XmtMenuItem structure. You can specify a name for a menu item described in a resource file by specifying the name followed by a colon as the first element in the menu item description. See Chapter 20, Easy Menu Creation, for more information. For menu items that are cascade buttons, XmtMenuItemGetSubmenu() returns the XmtMenu widget that forms the menu pane attached to that cascade button. If you call this function for a menu item that is not a cascade button, it will print an error message. XmtMenuItemGetWidget() returns the widget associated with any menu item. This may be an XmPushButton, an XmToggleButton, an XmCascadeButton, an XmLabel, or an XmSeparator. XmtMenuItemSetSensitivity() lets you set the sensitivity of a menu item. Like XtSetSensitive(), the second argument to XmtMenuItemSetSensitivity() is a Boolean. If True, the item will be made sensitive; if False, the item will be made insensitive, and will be grayed out. Unlike XtSetSensitive(), however, XmtMenuItemSetSensitivity() keeps a count of how many times it has been called for an item. If the function is called twice for an item with the sensitive argument of False, then the item will not become sensitive again until the function is called twice with the argument True. XmtMenuItemGetState() returns True if the specified toggle button is selected, and False otherwise. This function will print a warning message if called for a menu item that is not a toggle button. XmtMenuItemSetState() sets the button state as specified by the state argument, and if notify is True, it calls any callbacks registered for the toggle button. This function will print a warning message if called for a menu item that is not a toggle button. SEE ALSOChapter 20, Easy Menu Creation,XmtMenu, XmtMenuActivateProcedure(), XmtMenuInactivateProcedure().
Visit the GSP FreeBSD Man Page Interface. |