12.07.2015 Views

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4. MenusThe <strong>Athena</strong> widget set provides support for single paned non-hierarchical popupand pulldown menus. Since menus are such a common user interface tool, supportfor them must be provided in even the most basic widget sets. In menuing as inother areas, the <strong>Athena</strong> <strong>Widget</strong> <strong>Set</strong> provides only basic functionality.Menus in the <strong>Athena</strong> widget set are implemented as a menu container (the Simple-Menu widget) and a collection of objects that comprise the menu entries. The SimpleMenuwidget is itself a direct subclass of the OverrideShell widget class, so noother shell is necessary when creating a menu. The managed children of a Simple-Menu must be subclasses of the Sme (Simple Menu Entry) object.The <strong>Athena</strong> widget set provides three classes of Sme objects that may be used tobuild menus.SmeSme-BSBSme-LineThe base class of all menu entries. It may be used as a menu entry itselfto provide blank space in a menu. "Sme" means "Simple Menu Entry."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."This menu entry provides an unselectable entry containing a separatorline.The SimpleMenu widget informs the window manager that it should ignore its windowby setting the Override Redirect flag. This is the correct behavior for thepress-drag-release style of menu operation. If click-move-click or "pinable" menusare desired it is the responsibility of the application programmer, using the Simple-Menu resources, to inform the window manager of the menu.To allow easy creation of pulldown menus, a MenuButton widget is also providedas part of the <strong>Athena</strong> widget set.Using the MenusThe default configuration for the menus is press-drag-release. The menus will typicallybe 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 isa pulldown menu. Menus may also be activated when a specific pointer and/or keysequence is used anywhere in the application; this is a popup menu (e.g. clickingCtrl- in the common application xterm). In this case the menushould be positioned under the cursor. Typically menus will be placed so the pointercursor is on the first menu entry, or the last entry selected by the user.The menu remains on the screen as long as the pointer button is held down. Movingthe pointer will highlight different menu items. If the pointer leaves the menu, ormoves over an entry that cannot be selected then no menu entry will highlighted.When the desired menu entry has been highlighted, releasing the pointer buttonremoves the menu, and causes any mechanism associated with this entry to be invoked.58

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!