1421c997bSmrg<chapter id='Menus'> 2994689c1Smrg<title>Menus</title> 3994689c1Smrg<para> 4994689c1SmrgThe Athena widget set provides support for single paned non-hierarchical 5994689c1Smrgpopup and pulldown menus. Since menus are such a common user interface 6994689c1Smrgtool, support for them must be provided in even the most basic widget 7994689c1Smrgsets. In menuing as in other areas, the Athena Widget Set provides only 8994689c1Smrgbasic functionality. 9994689c1Smrg</para> 10994689c1Smrg<para> 11994689c1SmrgMenus in the Athena widget set are implemented as a menu container (the 12994689c1SmrgSimpleMenu widget) and a collection of objects that comprise the 13994689c1Smrgmenu entries. The SimpleMenu widget is itself a direct subclass of the 14994689c1SmrgOverrideShell widget class, so no other shell is necessary when 15994689c1Smrgcreating a menu. The managed children of a SimpleMenu must be 16994689c1Smrgsubclasses of the Sme (Simple Menu Entry) object. 17994689c1Smrg</para> 18994689c1Smrg<para> 19994689c1SmrgThe Athena widget set provides three classes of Sme objects that may be 20994689c1Smrgused to build menus. 21994689c1Smrg</para> 22994689c1Smrg<para> 23994689c1Smrg<variablelist> 24994689c1Smrg <varlistentry> 25994689c1Smrg <term>Sme</term> 26994689c1Smrg <listitem> 27994689c1Smrg <para> 28994689c1SmrgThe base class of all menu entries. It may be used as a menu entry 29994689c1Smrgitself to provide blank space in a menu. "Sme" means "Simple Menu 30994689c1SmrgEntry." 31994689c1Smrg </para> 32994689c1Smrg </listitem> 33994689c1Smrg </varlistentry> 34994689c1Smrg <varlistentry> 35994689c1Smrg <term>SmeBSB</term> 36994689c1Smrg <listitem> 37994689c1Smrg <para> 38994689c1SmrgThis menu entry provides a selectable entry containing a text string. 39994689c1SmrgA bitmap may also be placed in the left and right margins. "BSB" means 40994689c1Smrg"Bitmap String Bitmap." 41994689c1Smrg </para> 42994689c1Smrg </listitem> 43994689c1Smrg </varlistentry> 44994689c1Smrg <varlistentry> 45994689c1Smrg <term>SmeLine</term> 46994689c1Smrg <listitem> 47994689c1Smrg <para> 48994689c1SmrgThis menu entry provides an unselectable entry containing a separator line. 49994689c1Smrg </para> 50994689c1Smrg </listitem> 51994689c1Smrg </varlistentry> 52994689c1Smrg</variablelist> 53994689c1Smrg</para> 54994689c1Smrg<para> 55994689c1SmrgThe SimpleMenu widget informs the window manager that it should ignore 56994689c1Smrgits window by setting the <function>Override Redirect</function> flag. This is the 57994689c1Smrgcorrect behavior for the press-drag-release style of menu operation. If 58994689c1Smrgclick-move-click or "pinable" menus are desired it is the 59994689c1Smrgresponsibility of the application programmer, using the SimpleMenu 60994689c1Smrgresources, to inform the window manager of the menu. 61994689c1Smrg</para> 62994689c1Smrg<para> 63994689c1SmrgTo allow easy creation of pulldown menus, a MenuButton widget is 64994689c1Smrgalso provided as part of the Athena widget set. 65994689c1Smrg</para> 66994689c1Smrg<sect1 id="Using_the_Menus"> 67994689c1Smrg<title>Using the Menus</title> 68994689c1Smrg<!-- .XS --> 69994689c1Smrg<!-- Using the Menus --> 70994689c1Smrg<!-- .XE --> 715ec34c4cSmrg<indexterm><primary>Menus</primary><secondary>using</secondary></indexterm> 72994689c1Smrg<para> 73994689c1Smrg<!-- .LP --> 74994689c1SmrgThe default configuration for the menus is press-drag-release. 75994689c1SmrgThe menus will typically be 76994689c1Smrgactivated by clicking a pointer button while the pointer is over a 77994689c1SmrgMenuButton, causing the menu to appear in a fixed location relative to 78994689c1Smrgthat button; this is a <function>pulldown</function> menu. Menus may also be activated 795ec34c4cSmrg<indexterm><primary>Menus</primary><secondary>pulldown</secondary></indexterm> 80994689c1Smrgwhen a specific pointer and/or key sequence is used anywhere in the 81994689c1Smrgapplication; this is a <function>popup</function> menu (e.g. clicking Ctrl-<pointer 825ec34c4cSmrg<indexterm><primary>Menus</primary><secondary>popup</secondary></indexterm> 83994689c1Smrgbutton 1> in the common application <function>xterm</function>). In this 84994689c1Smrgcase the menu should be positioned under 85994689c1Smrgthe cursor. Typically menus will be placed so the pointer cursor is on 86994689c1Smrgthe first menu entry, or the last entry selected by the user. 87994689c1Smrg</para> 88994689c1Smrg<para> 89994689c1Smrg<!-- .LP --> 90994689c1SmrgThe menu remains on the screen as long as the pointer button is held 91994689c1Smrgdown. Moving the pointer will highlight different menu items. 92994689c1SmrgIf the pointer leaves the menu, or moves over an entry that cannot 93994689c1Smrgbe selected then no menu entry will highlighted. When the desired menu 94994689c1Smrgentry has been highlighted, releasing the pointer button removes the menu, 95994689c1Smrgand causes any mechanism associated with this entry to be invoked. 96994689c1Smrg 97994689c1Smrg</para> 98994689c1Smrg</sect1> 995ec34c4cSmrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="SimpleMenu.xml"/> 100994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="SmeBSB.xml"/> 101994689c1Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="SmeLine.xml"/> 1025ec34c4cSmrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Sme.xml"/> 1035ec34c4cSmrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="MenuButton.xml"/> 104994689c1Smrg</chapter> 105