Specifications
Athena Widget Set libXaw 1.0.7
Chapter 4
Menus
The Athena widget set provides support for single paned non-hierarchical popup and pulldown
menus. Since menus are such a common user interface tool, support for them must be provided
in eventhe most basic widget sets. In menuing as in other areas, the Athena Widget Set provides
only basic functionality.
Menus in the Athena widget set are implemented as a menu container (the SimpleMenu widget)
and a collection of objects that comprise the menu entries. The SimpleMenu widget is itself a
direct subclass of the OverrideShell widget class, so no other shell is necessary when creating a
menu. The managed children of a SimpleMenu must be subclasses of the Sme (Simple Menu
Entry) object.
The Athena widget set provides three classes of Sme objects that may be used to build menus.
Sme The base class of all menu entries. It may be used as a menu entry itself to pro-
vide blank space in a menu. ‘‘Sme’’means ‘‘Simple Menu Entry.’’
SmeBSB This menu entry provides a selectable entry containing a text string. Abitmap
may also be placed in the left and right margins. ‘‘BSB’’means ‘‘Bitmap String
Bitmap.’’
SmeLine This menu entry provides an unselectable entry containing a separator line.
The SimpleMenu widget informs the windowmanager that it should ignore its windowbysetting
the Override Redirect flag. This is the correct behavior for the press-drag-release style of menu
operation. If click-move-click or ‘‘pinable’’’ menus are desired it is the responsibility of the
application programmer,using the SimpleMenu resources, to inform the windowmanager of the
menu.
To alloweasy creation of pulldown menus, a MenuButton widget is also provided as part of the
Athena widget set.
4.1. Using the Menus
The default configuration for the menus is press-drag-release. The menus will typically be acti-
vated by clicking a pointer button while the pointer is overaMenuButton, causing the menu to
appear in a fixed location relative tothat button; this is a pulldown menu. Menus may also be
activated when a specific pointer and/or key sequence is used anywhere in the application; this is
a popup menu (e.g. clicking Ctrl-<pointer button 1> in the common application xterm). In this
case the menu should be positioned under the cursor.Typically menus will be placed so the
pointer cursor is on the first menu entry,orthe last entry selected by the user.
The menu remains on the screen as long as the pointer button is held down. Moving the pointer
will highlight different menu items. If the pointer leavesthe menu, or movesoveranentry that
cannot be selected then no menu entry will highlighted. When the desired menu entry has been
highlighted, releasing the pointer button removesthe menu, and causes anymechanism associated
with this entry to be invoked.
4.2. SimpleMenu Widget
Application Header file <X11/Xaw/SimpleMenu.h>
Class Header file <X11/Xaw/SimpleMenP.h>
58