home *** CD-ROM | disk | FTP | other *** search
- .bp
- \&
- .sp 1
- .ce 3
- \s+1\fBChapter 4\fP\s-1
-
- \s+1\fBMenus\fP\s-1
- .sp 2
- .nr H1 4
- .nr H2 0
- .nr H3 0
- .nr H4 0
- .nr H5 0
- .na
- .LP
- .XS
- Chapter 4 - Menus
- .XE
- .IN "Menus" ""
- .LP
- 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 even the most basic widget
- sets. Since the resources available for this task were limited, it was
- decided that the Athena widget set would provide only the basic
- functionality, and deliberately did not attempt to solve the entire
- problem.
- .LP
- Menus in the Athena widget set are implemented as a Menu container (the
- SimpleMenu widget) and a collection of objects that will comprise the
- menu entries. The SimpleMenu widget is itself a direct subclass of the
- OverrideShell widget class, therefore 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.
- .LP
- The Athena widget set provides three classes of Sme objects that may be
- used to build menus.
- .sp
- .IP \fBSme\fP 1i
- .IN "Sme object" "
- The base class of all menu entries. It may be used as a menu entry
- itself to provide blank space in a menu.
- .IP \fBSmeBSB\fP 1i
- .IN "SmeBSB object" ""
- This menu entry provides a selectable entry containing a text string.
- Support is also provided that allows a bitmap to be placed in the
- left and right margins.
- .IP \fBSmeLine\fP 1i
- .IN "SmeLine object" ""
- This menu entry provides an unselectable entry containing a separator line.
- .sp
- .LP
- The SimpleMenu widget informs the window manager that it should ignore
- its window by setting the \fBOverride Redirect\fP flag. This is the
- correct behavior for the click-drag-release style of menu operation. If
- click-move-click or \fIpinable\fP menus are desired it is the
- responsibility of the application programmer, using the SimpleMenu
- resources, to inform the window manager of the menu.
- .LP
- To allow easy creation of pulldown menus, a MenuButton widget is
- also provided as part of the Athena widget set.
- .NH 2
- Using the Menus
- .XS
- Using the Menus
- .XE
- .IN "Menus" "using"
- .LP
- The default configuration for the menus is click-move-release, and it is
- this interface that I will describe. The menus will typically be
- activated by clicking a pointer button while the pointer is over a
- MenuButton, causing the menu to appear in a fixed location relative to
- that button; this is a \fBpulldown\fP menu. Menus may also be activated
- .IN "Menus" "pulldown"
- when a specific pointer and key sequence is used anywhere in the
- application; this is a \fBpopup\fP menu (e.g. clicking Ctrl-<pointer
- .IN "Menus" "popup"
- button 1> in xterm). In this case the menu will position itself under
- the cursor. Typically menus will be placed so the pointer cursor is on
- the first menu entry, or the last entry selected by the user.
- .LP
- The menu will remain on the screen as long as the pointer button is held
- down. Moving the pointer will highlight different menu items.
- If the pointer leaves the menu, or moves over an entry that cannot
- be selected then no menu entry will highlighted. When the desired menu
- entry has been highlighted, release the pointer button to remove the menu,
- and cause the action associated with this entry to be invoked.
-