XWPULLDOWN(3Xh) — Stardent Computer Inc.
NAME
XwpulldownWidgetClass - the X Widgets pulldown menu manager widget.
SYNOPSIS
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <Xw/Xw.h>
#include <Xw/Pulldown.h>
CLASSES
The pulldown menu manager widget is built out of the Core, Composite, Constraint, XwManager and XwMenuMgr classes. Note that the Constraint fields are not used in this widget and so are not listed in the resource tables below. Also, since the Composite class contains no user settable resources, there is no table for Composite class resources.
The widget class to use when creating an instance of the pulldown menu manager is XwpulldownWidgetClass. The class name is Pulldown.
DESCRIPTION
The pulldown menu manager widget is a composite widget which is used by an application to manage a collection of menupanes. Even though the pulldown menu manager is a composite widget, it should never have any normal widget children. Instead, all of its children are popup shell children; the child of each of the popup shell widgets is a menupane. In addition, the parent of the pulldown menu manager must be a popup shell widget, whose parent is the widget to which the menu tree is being associated.
The pulldown menu manager manages a collection of menupane widgets, which have been organized into a hierarchical tree structure; the root of the tree is referred to as the top level menupane. The pulldown menu manager creates a pulldown widget as a child of the widget to which the menu tree is associated; as the menu tree is constructed, titlebuttons will be added to the pulldown widget, thus providing the user with a means for posting a particular portion of the menu tree. As menupanes are added to the menu tree, if cascading submenus are allowed, then only those menupanes which cascade off of the top level menupane will be folded up as a first level menupane with a new titlebutton within the pulldown widget. If cascading submenus are not allowed, then all cascading menupanes will be folded up into a first level menupane with a new titlebutton.
When the user requests that the menu be posted, by generating a post event within one of the titlebuttons, the menupane associated with the indicated titlebutton is posted. As soon as a select event or an unpost event is generated, the menupanes are unposted.
Once the menu manager has posted a first level menupane, it will remain posted until either the user generates a select action, the user generates an unpost action, or the user moves the cursor into a different titlebutton. If the select action occurs, then the menupanes will be removed from the display, and the appropriate menubutton will perform any required actions. If the select action occurs outside of a menubutton, or if the unpost action is generated, then the menupanes are simply unposted. If the cursor was moved into a different titlebutton, then the menupanes associated with the previous titlebutton will be unposted, and the first level menupane for the new titlebutton will be posted.
The menu manager supports a mode by which the menu hierarchy may be associated only with the specified widget, or it may be associated with the widget and all of its children (both present and future children). If the menu is associated with the widget and its children, then a keyboard accelerator which occurs in either the widget or one of its children, will cause the appropriate action to occur.
The pulldown menu manager provides a keyboard interface to the menus, through the use of mnemonics and keyboard accelerators. A mnemonic may be used to post any of the first level menupanes; a posting mnemonic is issued by typing the appropriate mnemonic character in the presence of the modifiers specified by the postAccelerator resource. Keyboard accelerators are supported for selecting a menubutton from within any of the menupanes; accelerators are always active, even if the corresponding menubutton is not currently displayed. Keyboard mnemonics may also be used for selecting a menubutton; however, a menubutton’s mnemonic is only active if the menupane in which it resides in is currently displayed. The pulldown menu manager only allows the first level pulldown menupanes to have keyboard mnemonics for posting.
NEW RESOURCES
The pulldown menu manager defines a set of resource types which may be used by the programmer to specify the data for the menu manager. The programmer can also set the values for the Core, Composite and Manager widget classes to set attributes for this widget. To specify any of these resources within the .Xdefaults file, simply drop the XtN prefix from the resource name. The following table contains the set of resources defined by Pulldown.
| Pulldown Resource Set | |||
| Name | Class | Type | Default |
| XtNallowCascades | XtCAllowCascades | Boolean | TRUE |
| XtNpostAccelerator | XtCPostAccelerator | String | "Meta" |
| XtNpulldownBarId | XtCPulldownBarId | Widget | NULL |
XtNallowCascades
This resource is used to control whether any of the top level pulldown menupanes may have other menupanes cascading off of them. This resource must be set to the desired value when the menu manager widget is first created; it cannot be modified after the widget has been created.
XtNpostAccelerator
This resource is used to specify the keyboard modifiers which must be present when one of the post mnemonics is issued by the user. This resource must be set to the desired value when the menu manager widget is first created; it cannot be modified after the widget has been created.
XtNpulldownBarId
This resource is a read-only resource, and provides the application with the means for obtaining the widget Id for the frame widget which encloses the pulldown menubar widget. Applications should not use this to modify the attributes of the pulldown menubar. This resource is made available to allow applications to obtain the pulldown menubar Id, which is needed when attempting to add a pulldown menu to a widget which is not menu smart.
INHERITED RESOURCES
The following resources are inherited from the named superclasses:
| Core Resource Set -- CORE(3X) | |||
| Name | Class | Type | Default |
| XtNancestorSensitive | XtCSenstitive | Boolean | TRUE |
| XtNx | XtCPosition | int | 0 |
| XtNy | XtCPosition | int | 0 |
| XtNwidth | XtCWidth | int | 0 |
| XtNheight | XtCHeight | int | 0 |
| XtNdepth | XtCDepth | int | 0 |
| XtNbackground | XtCBackground | Pixel | White |
| XtNbackgroundPixmap | XtCPixmap | Pixmap | Unspecified |
| XtNborderWidth | XtCBorderWidth | int | 1 |
| XtNborderColor | XtCBorderColor | Pixel | Black |
| XtNborderPixmap | XtCPixmap | Pixmap | Unspecified |
| XtNsensitive | XtCSensitive | Boolean | TRUE |
| XtNmappedWhenManaged | XtCMappedWhenManaged | Boolean | TRUE |
| XtNdestroyCallback | XtCCallback | Pointer | NULL |
| XtNtranslations | XtCTranslations | XtTranslations | NULL |
| Manager Resource Set -- XWMANAGER(3X) | |||
| Name | Class | Type | Default |
| XtNforeground | XtCForeground | Pixel | Black |
| XtNbackgroundTile | XtCBackgroundTile | int | background |
| XtNhighlightThickness | XtCHighlightThickness | int | 0 |
| XtNtraversalOn | XtCTraversalOn | Boolean | FALSE |
| XtNshadowOn | XtCShadowOn | Boolean | TRUE |
| XtNtopShadowColor | XtCBackground | Pixel | White |
| XtNtopShadowTile | XtCTopShadowTile | int | 50_foreground |
| XtNbottomShadowColor | XtCForeground | Pixel | Black |
| XtNbottomShadowTile | XtCBottomShadowTile | int | foreground |
| Menu Manager Resource Set -- XWMENUMGR(3X) | |||
| Name | Class | Type | Default |
| XtNassociateChildren | XtCAssociateChildren | Boolean | TRUE |
| XtNmenuPost | XtCMenuPost | String | "<Btn1Down>" |
| XtNmenuSelect | XtCMenuSelect | String | "<Btn1Up>" |
| XtNmenuUnpost | XtCMenuUnpost | String | NULL |
| XtNkbdSelect | XtCKbdSelect | String | "<Key>Select" |
PULLDOWN BUTTON RESOURCES
The pulldown menu manager is responsible for managing the set of menupanes specified by the application, and for creating pulldown buttons within the pulldown menu bar, as needed. When creating the pulldown buttons, certain resources are inherited from the menupane from which the pulldown button is derived, while other resources are inherited from the menu manager. When an application modifies one of these resources within the menupane or the menu manager, the attribute will also be passed on to the associated pulldown button. The following tables outline those resources which are inherited from the menupane and those which are inherited from the menu manager:
| Inherited MenuPane Resource Set | |||
| Name | Class | Type | Default |
| XtNfont | XtCFont | XFontStruct ∗ | "fixed" |
| XtNforeground | XtCForeground | Pixel | Black |
| XtNbackground | XtCBackground | Pixel | White |
| XtNbackgroundTile | XtCBackgroundTile | int | background |
| XtNtopShadowColor | XtCBackground | Pixel | White |
| XtNtopShadowTile | XtCTopShadowTile | int | 50_foreground |
| XtNbottomShadowColor | XtCForeground | Pixel | Black |
| XtNbottomShadowTile | XtCBottomShadowTile | int | foreground |
| Inherited Menu Manager Resource Set | |||
| Name | Class | Type | Default |
| XtNshadowOn | XtCShadowOn | Boolean | TRUE |
BUGS
Due to limitations within the Xt Intrinsics, keyboard accelerators for posting a menu pane or for selecting a menu item do not work if the widget to which the menu manager is attached has traversal enabled.
The pulldown menu manager currently does not support keyboard traversal.
ORIGIN
Hewlett-Packard Company.
SEE ALSO
CORE(3X), XWMANAGER(3X), XWMENUMGR(3X)
September 29, 2021