SimpleMenu.xml revision 994689c1
1994689c1Smrg<sect2 id="SimpleMenu_Widget"> 2994689c1Smrg<title>SimpleMenu Widget</title> 3994689c1Smrg<!-- .XS --> 4994689c1Smrg<!-- SimpleMenu Widget --> 5994689c1Smrg<!-- .XE --> 6994689c1Smrg<!-- .IN "SimpleMenu widget" "" "@DEF@" --> 7994689c1Smrg<literallayout class="monospaced"> 8994689c1Smrg<!-- .TA 2.0i --> 9994689c1Smrg<!-- .ta 2.0i --> 10994689c1Smrg<!-- .sp --> 11994689c1SmrgApplication Header file <X11/Xaw/SimpleMenu.h> 12994689c1Smrg<!-- .IN "SimpleMenu.h" "" --> 13994689c1SmrgClass Header file <X11/Xaw/SimpleMenP.h> 14994689c1Smrg<!-- .IN "SimpleMenP.h" "" --> 15994689c1SmrgClass simpleMenuWidgetClass 16994689c1Smrg<!-- .IN "simpleMenuWidgetClass" "" --> 17994689c1SmrgClass Name SimpleMenu 18994689c1Smrg<!-- .IN "SimpleMenu widget" "class name" --> 19994689c1SmrgSuperclass OverrideShell 20994689c1Smrg<!-- .sp --> 21994689c1Smrg</literallayout> 22994689c1Smrg<para> 23994689c1Smrg<!-- .LP --> 24994689c1SmrgThe SimpleMenu widget is a container for the menu entries. It is a 25994689c1Smrgdirect subclass of shell, and is should be created with 26994689c1Smrg<function>XtCreatePopupShell</function>, not <function>XtCreateManagedWidget</function>. This is the 27994689c1Smrgonly part of the menu that 28994689c1Smrgactually is associated with a window. The SimpleMenu serves as the glue to bind 29994689c1Smrgthe individual menu entries together into a menu. 30994689c1Smrg</para> 31994689c1Smrg<sect3 id="Resources"> 32994689c1Smrg<title>Resources</title> 33994689c1Smrg<para> 34994689c1Smrg<!-- .LP --> 35994689c1Smrg<!-- .IN "SimpleMenu widget" "resources" --> 36994689c1Smrg</para> 37994689c1Smrg<para> 38994689c1Smrg<!-- .LP --> 39994689c1SmrgThe resources associated with the SimpleMenu widget control aspects 40994689c1Smrgthat will affect the entire menu. 41994689c1Smrg<informaltable> 42994689c1Smrg <tgroup cols='5' align='center'> 43994689c1Smrg <colspec colname='c1'/> 44994689c1Smrg <colspec colname='c2'/> 45994689c1Smrg <colspec colname='c3'/> 46994689c1Smrg <colspec colname='c4'/> 47994689c1Smrg <colspec colname='c5'/> 48994689c1Smrg <thead> 49994689c1Smrg <row> 50994689c1Smrg <entry>Name</entry> 51994689c1Smrg <entry>Class</entry> 52994689c1Smrg <entry>Type</entry> 53994689c1Smrg <entry>Notes</entry> 54994689c1Smrg <entry>Default Value</entry> 55994689c1Smrg </row> 56994689c1Smrg </thead> 57994689c1Smrg <tbody> 58994689c1Smrg <row> 59994689c1Smrg <entry>accelerators</entry> 60994689c1Smrg <entry>Accelerators</entry> 61994689c1Smrg <entry>AcceleratorTable</entry> 62994689c1Smrg <entry></entry> 63994689c1Smrg <entry>NULL</entry> 64994689c1Smrg </row> 65994689c1Smrg <row> 66994689c1Smrg <entry>ancestorSensitive</entry> 67994689c1Smrg <entry>AncestorSensitive</entry> 68994689c1Smrg <entry>Boolean</entry> 69994689c1Smrg <entry>D</entry> 70994689c1Smrg <entry>True</entry> 71994689c1Smrg </row> 72994689c1Smrg <row> 73994689c1Smrg <entry>allowShellResize</entry> 74994689c1Smrg <entry>AllowShellResize</entry> 75994689c1Smrg <entry>Boolean</entry> 76994689c1Smrg <entry></entry> 77994689c1Smrg <entry>True</entry> 78994689c1Smrg </row> 79994689c1Smrg <row> 80994689c1Smrg <entry>background</entry> 81994689c1Smrg <entry>Background</entry> 82994689c1Smrg <entry>Pixel</entry> 83994689c1Smrg <entry></entry> 84994689c1Smrg <entry>XtDefaultBackground</entry> 85994689c1Smrg </row> 86994689c1Smrg <row> 87994689c1Smrg <entry>backgroundPixmap</entry> 88994689c1Smrg <entry>Pixmap</entry> 89994689c1Smrg <entry>Pixmap</entry> 90994689c1Smrg <entry></entry> 91994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 92994689c1Smrg </row> 93994689c1Smrg <row> 94994689c1Smrg <entry>backingStore</entry> 95994689c1Smrg <entry>BackingStore</entry> 96994689c1Smrg <entry>BackingStore</entry> 97994689c1Smrg <entry></entry> 98994689c1Smrg <entry>see below</entry> 99994689c1Smrg </row> 100994689c1Smrg <row> 101994689c1Smrg <entry>borderColor</entry> 102994689c1Smrg <entry>BorderColor</entry> 103994689c1Smrg <entry>Pixel</entry> 104994689c1Smrg <entry></entry> 105994689c1Smrg <entry>XtDefaultForeground</entry> 106994689c1Smrg </row> 107994689c1Smrg <row> 108994689c1Smrg <entry>borderPixmap</entry> 109994689c1Smrg <entry>Pixmap</entry> 110994689c1Smrg <entry>Pixmap</entry> 111994689c1Smrg <entry></entry> 112994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 113994689c1Smrg </row> 114994689c1Smrg <row> 115994689c1Smrg <entry>borderWidth</entry> 116994689c1Smrg <entry>BorderWidth</entry> 117994689c1Smrg <entry>Dimension</entry> 118994689c1Smrg <entry></entry> 119994689c1Smrg <entry>1</entry> 120994689c1Smrg </row> 121994689c1Smrg <row> 122994689c1Smrg <entry>bottomMargin</entry> 123994689c1Smrg <entry>VerticalMargins</entry> 124994689c1Smrg <entry>Dimension</entry> 125994689c1Smrg <entry></entry> 126994689c1Smrg <entry>0</entry> 127994689c1Smrg </row> 128994689c1Smrg <row> 129994689c1Smrg <entry>children</entry> 130994689c1Smrg <entry>ReadOnly</entry> 131994689c1Smrg <entry>WidgetList</entry> 132994689c1Smrg <entry>R</entry> 133994689c1Smrg <entry>NULL</entry> 134994689c1Smrg </row> 135994689c1Smrg <row> 136994689c1Smrg <entry>createPopupChildProc</entry> 137994689c1Smrg <entry>CreatePopupChildProc</entry> 138994689c1Smrg <entry>Function</entry> 139994689c1Smrg <entry></entry> 140994689c1Smrg <entry>NULL</entry> 141994689c1Smrg </row> 142994689c1Smrg <row> 143994689c1Smrg <entry>colormap</entry> 144994689c1Smrg <entry>Colormap</entry> 145994689c1Smrg <entry>Colormap</entry> 146994689c1Smrg <entry></entry> 147994689c1Smrg <entry>Parent's Colormap</entry> 148994689c1Smrg </row> 149994689c1Smrg <row> 150994689c1Smrg <entry>cursor</entry> 151994689c1Smrg <entry>Cursor</entry> 152994689c1Smrg <entry>Cursor</entry> 153994689c1Smrg <entry></entry> 154994689c1Smrg <entry>None</entry> 155994689c1Smrg </row> 156994689c1Smrg <row> 157994689c1Smrg <entry>depth</entry> 158994689c1Smrg <entry>Depth</entry> 159994689c1Smrg <entry>int</entry> 160994689c1Smrg <entry>C</entry> 161994689c1Smrg <entry>Parent's Depth</entry> 162994689c1Smrg </row> 163994689c1Smrg <row> 164994689c1Smrg <entry>destroyCallback</entry> 165994689c1Smrg <entry>Callback</entry> 166994689c1Smrg <entry>XtCallbackList</entry> 167994689c1Smrg <entry></entry> 168994689c1Smrg <entry>NULL</entry> 169994689c1Smrg </row> 170994689c1Smrg <row> 171994689c1Smrg <entry>geometry</entry> 172994689c1Smrg <entry>Geometry</entry> 173994689c1Smrg <entry>String</entry> 174994689c1Smrg <entry></entry> 175994689c1Smrg <entry>NULL</entry> 176994689c1Smrg </row> 177994689c1Smrg <row> 178994689c1Smrg <entry>height</entry> 179994689c1Smrg <entry>Height</entry> 180994689c1Smrg <entry>Dimension</entry> 181994689c1Smrg <entry></entry> 182994689c1Smrg <entry>Enough space to contain all entries</entry> 183994689c1Smrg </row> 184994689c1Smrg <row> 185994689c1Smrg <entry>label</entry> 186994689c1Smrg <entry>Label</entry> 187994689c1Smrg <entry>String</entry> 188994689c1Smrg <entry></entry> 189994689c1Smrg <entry>NULL</entry> 190994689c1Smrg </row> 191994689c1Smrg <row> 192994689c1Smrg <entry>labelClass</entry> 193994689c1Smrg <entry>LabelClass</entry> 194994689c1Smrg <entry>Pointer</entry> 195994689c1Smrg <entry></entry> 196994689c1Smrg <entry>SmeBSBObjectClass</entry> 197994689c1Smrg </row> 198994689c1Smrg <row> 199994689c1Smrg <entry>mappedWhenManaged</entry> 200994689c1Smrg <entry>MappedWhenManaged</entry> 201994689c1Smrg <entry>Boolean</entry> 202994689c1Smrg <entry></entry> 203994689c1Smrg <entry>True</entry> 204994689c1Smrg </row> 205994689c1Smrg <row> 206994689c1Smrg <entry>menuOnScreen</entry> 207994689c1Smrg <entry>MenuOnScreen</entry> 208994689c1Smrg <entry>Boolean</entry> 209994689c1Smrg <entry></entry> 210994689c1Smrg <entry>True</entry> 211994689c1Smrg </row> 212994689c1Smrg <row> 213994689c1Smrg <entry>numChildren</entry> 214994689c1Smrg <entry>ReadOnly</entry> 215994689c1Smrg <entry>Cardinal</entry> 216994689c1Smrg <entry>R</entry> 217994689c1Smrg <entry>0</entry> 218994689c1Smrg </row> 219994689c1Smrg <row> 220994689c1Smrg <entry>overrideRedirect</entry> 221994689c1Smrg <entry>OverrideRedirect</entry> 222994689c1Smrg <entry>Boolean</entry> 223994689c1Smrg <entry></entry> 224994689c1Smrg <entry>True</entry> 225994689c1Smrg </row> 226994689c1Smrg <row> 227994689c1Smrg <entry>popdownCallback</entry> 228994689c1Smrg <entry>Callback</entry> 229994689c1Smrg <entry>XtCallbackList</entry> 230994689c1Smrg <entry></entry> 231994689c1Smrg <entry>NULL</entry> 232994689c1Smrg </row> 233994689c1Smrg <row> 234994689c1Smrg <entry>popupCallback</entry> 235994689c1Smrg <entry>Callback</entry> 236994689c1Smrg <entry>XtCallbackList</entry> 237994689c1Smrg <entry></entry> 238994689c1Smrg <entry>NULL</entry> 239994689c1Smrg </row> 240994689c1Smrg <row> 241994689c1Smrg <entry>popupOnEntry</entry> 242994689c1Smrg <entry>PopupOnEntry</entry> 243994689c1Smrg <entry>Widget</entry> 244994689c1Smrg <entry>A</entry> 245994689c1Smrg <entry>Label or first entry</entry> 246994689c1Smrg </row> 247994689c1Smrg <row> 248994689c1Smrg <entry>rowHeight</entry> 249994689c1Smrg <entry>RowHeight</entry> 250994689c1Smrg <entry>Dimension</entry> 251994689c1Smrg <entry></entry> 252994689c1Smrg <entry>0</entry> 253994689c1Smrg </row> 254994689c1Smrg <row> 255994689c1Smrg <entry>saveUnder</entry> 256994689c1Smrg <entry>SaveUnder</entry> 257994689c1Smrg <entry>Boolean</entry> 258994689c1Smrg <entry></entry> 259994689c1Smrg <entry>False</entry> 260994689c1Smrg </row> 261994689c1Smrg <row> 262994689c1Smrg <entry>screen</entry> 263994689c1Smrg <entry>Screen</entry> 264994689c1Smrg <entry>Screen</entry> 265994689c1Smrg <entry>R</entry> 266994689c1Smrg <entry>Parent's Screen</entry> 267994689c1Smrg </row> 268994689c1Smrg <row> 269994689c1Smrg <entry>sensitive</entry> 270994689c1Smrg <entry>Sensitive</entry> 271994689c1Smrg <entry>Boolean</entry> 272994689c1Smrg <entry></entry> 273994689c1Smrg <entry>True</entry> 274994689c1Smrg </row> 275994689c1Smrg <row> 276994689c1Smrg <entry>topMargin</entry> 277994689c1Smrg <entry>VerticalMargins</entry> 278994689c1Smrg <entry>Dimension</entry> 279994689c1Smrg <entry></entry> 280994689c1Smrg <entry>0</entry> 281994689c1Smrg </row> 282994689c1Smrg <row> 283994689c1Smrg <entry>translations</entry> 284994689c1Smrg <entry>Translations</entry> 285994689c1Smrg <entry>TranslationTable</entry> 286994689c1Smrg <entry></entry> 287994689c1Smrg <entry>See below</entry> 288994689c1Smrg </row> 289994689c1Smrg <row> 290994689c1Smrg <entry>visual</entry> 291994689c1Smrg <entry>Visual</entry> 292994689c1Smrg <entry>Visual</entry> 293994689c1Smrg <entry></entry> 294994689c1Smrg <entry>CopyFromParent</entry> 295994689c1Smrg </row> 296994689c1Smrg <row> 297994689c1Smrg <entry>width</entry> 298994689c1Smrg <entry>Width</entry> 299994689c1Smrg <entry>Dimension</entry> 300994689c1Smrg <entry></entry> 301994689c1Smrg <entry>Width of widest entry</entry> 302994689c1Smrg </row> 303994689c1Smrg <row> 304994689c1Smrg <entry>x</entry> 305994689c1Smrg <entry>Position</entry> 306994689c1Smrg <entry>Position</entry> 307994689c1Smrg <entry></entry> 308994689c1Smrg <entry>0</entry> 309994689c1Smrg </row> 310994689c1Smrg <row> 311994689c1Smrg <entry>y</entry> 312994689c1Smrg <entry>Position</entry> 313994689c1Smrg <entry>Position</entry> 314994689c1Smrg <entry></entry> 315994689c1Smrg <entry>0</entry> 316994689c1Smrg </row> 317994689c1Smrg </tbody> 318994689c1Smrg </tgroup> 319994689c1Smrg</informaltable> 320994689c1Smrg<!-- .Ac --> 321994689c1Smrg<!-- .As --> 322994689c1Smrg<variablelist> 323994689c1Smrg <varlistentry> 324994689c1Smrg <term> 325994689c1Smrg <function>backingStore</function> 326994689c1Smrg </term> 327994689c1Smrg <listitem> 328994689c1Smrg <para> 329994689c1Smrg<!-- .IN "conversions" "BackingStore" --> 330994689c1SmrgDetermines what type of backing store will be used for the menu. Legal 331994689c1Smrgvalues for this resource are <function>NotUseful</function>, <function>WhenMapped</function>, and 332994689c1Smrg<function>Always</function>. These values are the backing-store integers defined in 333994689c1Smrg<X11/X.h>. 334994689c1Smrg<!-- .Rs "notUseful, whenMapped, always, \fPand\fP default" --> 335994689c1SmrgIf <function>default</function> is specified (the default behavior) the server will use 336994689c1Smrgwhatever it thinks is appropriate. 337994689c1Smrg<!-- .Bg --> 338994689c1Smrg<!-- .Gp --> 339994689c1Smrg<!-- .Bc --> 340994689c1Smrg<!-- .Bp --> 341994689c1Smrg<!-- .Bw --> 342994689c1Smrg </para> 343994689c1Smrg </listitem> 344994689c1Smrg </varlistentry> 345994689c1Smrg <varlistentry> 346994689c1Smrg <term> 347994689c1Smrg <function>bottomMargin</function> 348994689c1Smrg </term> 349994689c1Smrg <listitem> 350994689c1Smrg <para> 351994689c1Smrg<!-- .br --> 352994689c1Smrg<!-- .ns --> 353994689c1Smrg </para> 354994689c1Smrg </listitem> 355994689c1Smrg </varlistentry> 356994689c1Smrg <varlistentry> 357994689c1Smrg <term> 358994689c1Smrg <function>topMargin</function> 359994689c1Smrg </term> 360994689c1Smrg <listitem> 361994689c1Smrg <para> 362994689c1SmrgThe amount of space between the top or bottom of the menu and the menu entry 363994689c1Smrgclosest to that edge. 364994689c1Smrg<!-- .Ch --> 365994689c1Smrg<!-- .Cm --> 366994689c1Smrg </para> 367994689c1Smrg </listitem> 368994689c1Smrg </varlistentry> 369994689c1Smrg <varlistentry> 370994689c1Smrg <term> 371994689c1Smrg <function>cursor</function> 372994689c1Smrg </term> 373994689c1Smrg <listitem> 374994689c1Smrg <para> 375994689c1SmrgThe shape of the mouse pointer whenever it is in this widget. 376994689c1Smrg<!-- .Dp --> 377994689c1Smrg<!-- .Dc --> 378994689c1Smrg </para> 379994689c1Smrg </listitem> 380994689c1Smrg </varlistentry> 381994689c1Smrg <varlistentry> 382994689c1Smrg <term> 383994689c1Smrg geometry 384994689c1Smrg </term> 385994689c1Smrg <listitem> 386994689c1Smrg <para> 387994689c1SmrgIf this resource is specified it will override the x, y, width and 388994689c1Smrgheight of this widget. The format of this string is 389994689c1Smrg[<<emphasis remap='I'>width</emphasis>>x<<emphasis remap='I'>height</emphasis>>][{+ -} <<emphasis remap='I'>xoffset</emphasis>> {+ -}<<emphasis remap='I'>yoffset</emphasis>>]. 390994689c1Smrg<!-- .Hw --> 391994689c1Smrg </para> 392994689c1Smrg </listitem> 393994689c1Smrg </varlistentry> 394994689c1Smrg <varlistentry> 395994689c1Smrg <term> 396994689c1Smrg <function>label</function> 397994689c1Smrg </term> 398994689c1Smrg <listitem> 399994689c1Smrg <para> 400994689c1SmrgThis label will be placed at the top of the SimpleMenu, and may not be 401994689c1Smrghighlighted. The name of the 402994689c1Smrglabel object is <function>menuLabel</function>. Using this name it is possible to 403994689c1Smrgmodify the label's attributes through the resource database. When the label 404994689c1Smrgis created, the <function>label</function> is hard coded to the value of <function>label</function>, and 405994689c1Smrg<function>justify</function> is hard coded as <function>XtJustifyCenter</function>. 406994689c1Smrg </para> 407994689c1Smrg </listitem> 408994689c1Smrg </varlistentry> 409994689c1Smrg <varlistentry> 410994689c1Smrg <term> 411994689c1Smrg <function>labelClass</function> 412994689c1Smrg </term> 413994689c1Smrg <listitem> 414994689c1Smrg <para> 415994689c1SmrgSpecifies the type of Sme object created as the menu label. 416994689c1Smrg<!-- .Mm --> 417994689c1Smrg </para> 418994689c1Smrg </listitem> 419994689c1Smrg </varlistentry> 420994689c1Smrg <varlistentry> 421994689c1Smrg <term> 422994689c1Smrg <function>menuOnScreen</function> 423994689c1Smrg </term> 424994689c1Smrg <listitem> 425994689c1Smrg <para> 426994689c1SmrgIf the menu is automatically positioned under the cursor with the 427994689c1Smrg<function>XawPositionSimpleMenu</function> action, and this resource is <function>True</function>, 428994689c1Smrgthen the menu will always be fully visible on the screen. 429994689c1Smrg<!-- .Nc --> 430994689c1Smrg </para> 431994689c1Smrg </listitem> 432994689c1Smrg </varlistentry> 433994689c1Smrg <varlistentry> 434994689c1Smrg <term> 435994689c1Smrg overrideRedirect 436994689c1Smrg </term> 437994689c1Smrg <listitem> 438994689c1Smrg <para> 439994689c1SmrgDetermines the value of the override_redirect attribute of the 440994689c1SmrgSimpleMenu's window. The override_redirect attribute of a window 441994689c1Smrgdetermines whether or not a window manager may interpose itself between 442994689c1Smrgthis window and the root window of the display. For more information 443994689c1Smrgsee the <emphasis remap='I'>Interclient Communications Conventions Manual</emphasis>. 444994689c1Smrg </para> 445994689c1Smrg </listitem> 446994689c1Smrg </varlistentry> 447994689c1Smrg <varlistentry> 448994689c1Smrg <term> 449994689c1Smrg popdownCallback 450994689c1Smrg </term> 451994689c1Smrg <listitem> 452994689c1Smrg <para> 453994689c1Smrg<!-- .br --> 454994689c1Smrg<!-- .ns --> 455994689c1Smrg </para> 456994689c1Smrg </listitem> 457994689c1Smrg </varlistentry> 458994689c1Smrg <varlistentry> 459994689c1Smrg <term> 460994689c1Smrg popupCallback 461994689c1Smrg </term> 462994689c1Smrg <listitem> 463994689c1Smrg <para> 464994689c1SmrgThese callback functions are called by the Xt Intrinsics whenever the 465994689c1Smrgshell is popped up or down (See <emphasis remap='I'>(xT</emphasis> for details). 466994689c1Smrg </para> 467994689c1Smrg </listitem> 468994689c1Smrg </varlistentry> 469994689c1Smrg <varlistentry> 470994689c1Smrg <term> 471994689c1Smrg <function>popupOnEntry</function> 472994689c1Smrg </term> 473994689c1Smrg <listitem> 474994689c1Smrg <para> 475994689c1SmrgThe <function>XawPositionSimpleMenu</function> action will, by default, popup the 476994689c1SmrgSimpleMenu with its label (or first entry) directly under the 477994689c1Smrgpointer. To popup the menu under 478994689c1Smrganother entry, set this resource to the menu entry that should be 479994689c1Smrgunder the pointer, when the menu is popped up. This allows the 480994689c1Smrgapplication to offer the user a default menu entry that can be selected 481994689c1Smrgwith out moving the pointer. 482994689c1Smrg </para> 483994689c1Smrg </listitem> 484994689c1Smrg </varlistentry> 485994689c1Smrg <varlistentry> 486994689c1Smrg <term> 487994689c1Smrg <function>rowHeight</function> 488994689c1Smrg </term> 489994689c1Smrg <listitem> 490994689c1Smrg <para> 491994689c1SmrgIf this resources is zero (the default) then each menu entry will be 492994689c1Smrggiven its desired height. If this resource has any other value then 493994689c1Smrgall menu entries will be forced to be <function>rowHeight</function> pixels high. 494994689c1Smrg </para> 495994689c1Smrg </listitem> 496994689c1Smrg </varlistentry> 497994689c1Smrg <varlistentry> 498994689c1Smrg <term> 499994689c1Smrg saveUnder 500994689c1Smrg </term> 501994689c1Smrg <listitem> 502994689c1Smrg <para> 503994689c1SmrgIf this is <function>True</function> then save unders will be active on the menu's window. 504994689c1Smrg<!-- .Sc --> 505994689c1Smrg<!-- .Se --> 506994689c1Smrg<!-- .Tr --> 507994689c1Smrg<!-- .Xy --> 508994689c1Smrg </para> 509994689c1Smrg </listitem> 510994689c1Smrg </varlistentry> 511994689c1Smrg</variablelist> 512994689c1Smrg</para> 513994689c1Smrg</sect3> 514994689c1Smrg<sect3 id="SimpleMenu_Actions"> 515994689c1Smrg<title>SimpleMenu Actions</title> 516994689c1Smrg<!-- .IN "SimpleMenu widget" "actions" --> 517994689c1Smrg<para> 518994689c1Smrg<!-- .LP --> 519994689c1SmrgThe SimpleMenu widget supports the following actions: 520994689c1Smrg</para> 521994689c1Smrg<itemizedlist> 522994689c1Smrg <listitem> 523994689c1Smrg <para> 524994689c1SmrgSwitching the entry under the mouse pointer between 525994689c1Smrgthe foreground and background colors with <function>highlight</function> 526994689c1Smrgand <function>unhighlight</function> 527994689c1Smrg </para> 528994689c1Smrg </listitem> 529994689c1Smrg <listitem> 530994689c1Smrg <para> 531994689c1SmrgProcessing menu entry callbacks with <function>notify</function> 532994689c1Smrg<!-- .sp --> 533994689c1Smrg </para> 534994689c1Smrg </listitem> 535994689c1Smrg</itemizedlist> 536994689c1Smrg<para> 537994689c1Smrg<!-- .LP --> 538994689c1Smrg<!-- .IN "SimpleMenu widget" "default translations" --> 539994689c1SmrgThe following are the default translation bindings used 540994689c1Smrgby the SimpleMenu widget: 541994689c1Smrg</para> 542994689c1Smrg<para> 543994689c1Smrg<!-- .LP --> 544994689c1Smrg<!-- .sp --> 545994689c1Smrg<literallayout class="monospaced"> 546994689c1Smrg<!-- .TA .5i 2.25i --> 547994689c1Smrg<!-- .ta .5i 2.25i --> 548994689c1Smrg <EnterWindow>: highlight(\|) 549994689c1Smrg <LeaveWindow>: unhighlight(\|) 550994689c1Smrg <BtnMotion>: highlight(\|) 551994689c1Smrg <BtnUp>: MenuPopdown(\|) notify(\|) unhighlight(\|) 552994689c1Smrg</literallayout> 553994689c1Smrg<!-- .sp --> 554994689c1Smrg</para> 555994689c1Smrg<para> 556994689c1Smrg<!-- .LP --> 557994689c1Smrg<!-- .IN "SimpleMenu widget" "MenuPopdown routine" --> 558994689c1SmrgThe user can pop down the menu without activating any of the callback 559994689c1Smrgfunctions by releasing the pointer button when no menu item is 560994689c1Smrghighlighted. 561994689c1Smrg<!-- .sp --> 562994689c1Smrg</para> 563994689c1Smrg<para> 564994689c1Smrg<!-- .LP --> 565994689c1SmrgThe full list of actions supported by SimpleMenu is: 566994689c1Smrg<variablelist> 567994689c1Smrg <varlistentry> 568994689c1Smrg <term> 569994689c1Smrg <function>highlight</function>() 570994689c1Smrg </term> 571994689c1Smrg <listitem> 572994689c1Smrg <para> 573994689c1SmrgHighlight the menu entry that is currently under the pointer. 574994689c1SmrgOnly a item that is highlighted will be notified when the <function>notify</function> 575994689c1Smrgaction is invoked. The look of a highlighted entry is determined by 576994689c1Smrgthe menu entry. 577994689c1Smrg </para> 578994689c1Smrg </listitem> 579994689c1Smrg </varlistentry> 580994689c1Smrg <varlistentry> 581994689c1Smrg <term> 582994689c1Smrg <function>unhighlight</function>(\|) 583994689c1Smrg </term> 584994689c1Smrg <listitem> 585994689c1Smrg <para> 586994689c1SmrgUnhighlights the currently highlighted menu item, and returns it to 587994689c1Smrgits normal look. 588994689c1Smrg </para> 589994689c1Smrg </listitem> 590994689c1Smrg </varlistentry> 591994689c1Smrg <varlistentry> 592994689c1Smrg <term> 593994689c1Smrg <function>notify</function>(\|) 594994689c1Smrg </term> 595994689c1Smrg <listitem> 596994689c1Smrg <para> 597994689c1SmrgNotifies the menu entry that is currently highlighted that is has been 598994689c1Smrgselected. It is the responsibility of the menu entry to take the 599994689c1Smrgappropriate action. 600994689c1Smrg </para> 601994689c1Smrg </listitem> 602994689c1Smrg </varlistentry> 603994689c1Smrg <varlistentry> 604994689c1Smrg <term> 605994689c1Smrg <function>MenuPopdown</function>(<emphasis remap='I'>menu</emphasis>) 606994689c1Smrg </term> 607994689c1Smrg <listitem> 608994689c1Smrg <para> 609994689c1SmrgThis action is defined in <emphasis remap='I'>(xT</emphasis>. 610994689c1Smrg<!-- .IN "SimpleMenu widget" "MenuPopdown routine" --> 611994689c1Smrg </para> 612994689c1Smrg </listitem> 613994689c1Smrg </varlistentry> 614994689c1Smrg</variablelist> 615994689c1Smrg</para> 616994689c1Smrg</sect3> 617994689c1Smrg<sect3 id="Positioning_the_SimpleMenu"> 618994689c1Smrg<title>Positioning the SimpleMenu</title> 619994689c1Smrg<!-- .IN "XawPositionSimpleMenu" "" "@DEF@" --> 620994689c1Smrg<!-- .IN "SimpleMenu widget" "positioning" "@DEF@" --> 621994689c1Smrg<para> 622994689c1Smrg<!-- .LP --> 623994689c1SmrgIf the SimpleMenu widget is to be used as a pulldown menu then the 624994689c1SmrgMenuButton widget, or some other outside means should be used to place 625994689c1Smrgthe menu when it is popped up. 626994689c1Smrg</para> 627994689c1Smrg<para> 628994689c1Smrg<!-- .LP --> 629994689c1SmrgIf popup menus are desired it will be necessary to add the 630994689c1Smrg<function>XawPositionSimpleMenu</function> and <function>MenuPopup</function> actions to the 631994689c1Smrgtranslation table of the widget that will be popping up the menu. The 632994689c1Smrg<function>MenuPopup</function> action is described in <emphasis remap='I'>(xT</emphasis>. 633994689c1Smrg<function>XawPositionSimpleMenu</function> is a global action procedure registered by 634994689c1Smrgthe SimpleMenu widget when the first one is created or the convenience 635994689c1Smrgroutine <function>XawSimpleMenuAddGlobalActions</function> is called. 636994689c1Smrg</para> 637994689c1Smrg<para> 638994689c1Smrg<!-- .LP --> 639994689c1SmrgTranslation writers should be aware that Xt does not register grabs on 640994689c1Smrg``don't care'' modifiers, and therefore the left hand side of the 641994689c1Smrgproduction should be written to exclude unspecified modifiers. 642994689c1SmrgFor example these are the translations needed to popup some of 643994689c1Smrg<function>xterm's</function> menus: 644994689c1Smrg<!-- .sp --> 645994689c1Smrg</para> 646994689c1Smrg<para> 647994689c1Smrg<!-- .LP --> 648994689c1Smrg<literallayout class="monospaced"> 649994689c1Smrg<!-- .TA .5i 2.25i --> 650994689c1Smrg<!-- .ta .5i 2.25i --> 651994689c1Smrg !Ctrl<Btn1Down>: XawPositionSimpleMenu(xterm) MenuPopup(xterm) 652994689c1Smrg !Ctrl<Btn2Down>: XawPositionSimpleMenu(modes) MenuPopup(modes) 653994689c1Smrg</literallayout> 654994689c1Smrg<!-- .sp 1 --> 655994689c1Smrg</para> 656994689c1Smrg<para> 657994689c1Smrg<!-- .LP --> 658994689c1Smrg<variablelist> 659994689c1Smrg <varlistentry> 660994689c1Smrg <term> 661994689c1Smrg <function>XawPositionSimpleMenu</function>(<emphasis remap='I'>menu</emphasis>) 662994689c1Smrg </term> 663994689c1Smrg <listitem> 664994689c1Smrg <para> 665994689c1SmrgThe <function>XawPositionSimpleMenu</function> routine will search for the menu name 666994689c1Smrgpassed to it using <function>XtNameToWidget</function> starting with the widget 667994689c1Smrginvoking the action as the reference widget. If it is unsuccessful it 668994689c1Smrgwill continue up the widget tree using each of the invoking widget's 669994689c1Smrgancestors as the reference widget. If it is still unsuccessful it will 670994689c1Smrgprint a warning message and give up. <function>XawPositionSimpleMenu</function> will 671994689c1Smrgposition the menu directly under the pointer cursor. The menu will be 672994689c1Smrgplaced so that the pointer cursor is centered on the entry named by the 673994689c1Smrg<function>popupOnEntry</function> resource. If the <function>menuOnScreen</function> resource is 674994689c1Smrg<function>True</function> then the menu will always be fully visible on the screen. 675994689c1Smrg </para> 676994689c1Smrg </listitem> 677994689c1Smrg </varlistentry> 678994689c1Smrg</variablelist> 679994689c1Smrg</para> 680994689c1Smrg</sect3> 681994689c1Smrg<sect3 id="Convenience_Routines"> 682994689c1Smrg<title>Convenience Routines</title> 683994689c1Smrg<sect4 id="Registering_the_Global_Action_Routines"> 684994689c1Smrg<title>Registering the Global Action Routines</title> 685994689c1Smrg<para> 686994689c1Smrg<!-- .LP --> 687994689c1Smrg<!-- .IN "XawPositionSimpleMenu" "" --> 688994689c1SmrgThe <function>XawPositionSimpleMenu</function> action routine may often be invoked 689994689c1Smrgbefore any menus have been created. This can occur when an 690994689c1Smrgapplication uses dynamic menu creation. In these cases an application will 691994689c1Smrgneed to register this global action routine by calling 692994689c1Smrg<function>XawSimpleMenuAddGlobalActions</function>: 693994689c1Smrg<!-- .IN "XawSimpleMenuAddGlobalActions" "" "@DEF@" --> 694994689c1Smrg<funcsynopsis> 695994689c1Smrg<funcprototype> 696994689c1Smrg <funcdef>void<function> XawSimpleMenuAddGlobalActions</function></funcdef> 697994689c1Smrg <paramdef>XtAppContext<parameter> app_con</parameter></paramdef> 698994689c1Smrg</funcprototype> 699994689c1Smrg</funcsynopsis> 700994689c1Smrg<!-- .FN --> 701994689c1Smrg<variablelist> 702994689c1Smrg <varlistentry> 703994689c1Smrg <term> 704994689c1Smrg <emphasis remap='I'>app_con</emphasis> 705994689c1Smrg </term> 706994689c1Smrg <listitem> 707994689c1Smrg <para> 708994689c1SmrgSpecifies the application context in which this action should be registered. 709994689c1Smrg </para> 710994689c1Smrg </listitem> 711994689c1Smrg </varlistentry> 712994689c1Smrg</variablelist> 713994689c1Smrg</para> 714994689c1Smrg<para> 715994689c1Smrg<!-- .LP --> 716994689c1SmrgThis function need only be called once per application and must be 717994689c1Smrgcalled before any widget that uses <function>XawPositionSimpleMenu</function> action 718994689c1Smrgis realized. 719994689c1Smrg</para> 720994689c1Smrg</sect4> 721994689c1Smrg<sect4 id="Getting_and_Clearing_the_Current_Menu_Entry"> 722994689c1Smrg<title>Getting and Clearing the Current Menu Entry</title> 723994689c1Smrg<para> 724994689c1Smrg<!-- .LP --> 725994689c1SmrgTo get the currently highlighted menu entry use 726994689c1Smrg<function>XawSimpleMenuGetActiveEntry</function>: 727994689c1Smrg<!-- .IN "XawSimpleMenuGetActiveEntry" "" "@DEF@" --> 728994689c1Smrg<funcsynopsis> 729994689c1Smrg<funcprototype> 730994689c1Smrg <funcdef>Widget<function> XawSimpleMenuGetActiveEntry</function></funcdef> 731994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 732994689c1Smrg</funcprototype> 733994689c1Smrg</funcsynopsis> 734994689c1Smrg<!-- .FN --> 735994689c1Smrg<variablelist> 736994689c1Smrg <varlistentry> 737994689c1Smrg <term> 738994689c1Smrg <emphasis remap='I'>w</emphasis> 739994689c1Smrg </term> 740994689c1Smrg <listitem> 741994689c1Smrg <para> 742994689c1SmrgSpecifies the SimpleMenu widget. 743994689c1Smrg </para> 744994689c1Smrg </listitem> 745994689c1Smrg </varlistentry> 746994689c1Smrg</variablelist> 747994689c1Smrg</para> 748994689c1Smrg<para> 749994689c1Smrg<!-- .LP --> 750994689c1SmrgThis function returns the menu entry that is 751994689c1Smrgcurrently highlighted, or NULL if no entry is highlighted. 752994689c1Smrg</para> 753994689c1Smrg<para> 754994689c1Smrg<!-- .LP --> 755994689c1Smrg<!-- .sp --> 756994689c1SmrgTo clear the SimpleMenu widget's internal information about the 757994689c1Smrgcurrently highlighted menu entry use 758994689c1Smrg<function>XawSimpleMenuClearActiveEntry</function>: 759994689c1Smrg<!-- .IN "XawSimpleMenuClearActiveEntry" "" "@DEF@" --> 760994689c1Smrg<funcsynopsis> 761994689c1Smrg<funcprototype> 762994689c1Smrg <funcdef>Widget<function> XawSimpleMenuClearActiveEntry</function></funcdef> 763994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 764994689c1Smrg</funcprototype> 765994689c1Smrg</funcsynopsis> 766994689c1Smrg<!-- .FN --> 767994689c1Smrg<variablelist> 768994689c1Smrg <varlistentry> 769994689c1Smrg <term> 770994689c1Smrg <emphasis remap='I'>w</emphasis> 771994689c1Smrg </term> 772994689c1Smrg <listitem> 773994689c1Smrg <para> 774994689c1SmrgSpecifies the SimpleMenu widget. 775994689c1Smrg </para> 776994689c1Smrg </listitem> 777994689c1Smrg </varlistentry> 778994689c1Smrg</variablelist> 779994689c1Smrg</para> 780994689c1Smrg<para> 781994689c1Smrg<!-- .LP --> 782994689c1SmrgThis function unsets all internal references to the currently 783994689c1Smrghighlighted menu entry. It does not <emphasis remap='I'>unhighlight</emphasis> or otherwise 784994689c1Smrgalter the appearance of the active entry. This function is primarily 785994689c1Smrgfor use by implementors of menu entries. 786994689c1Smrg 787994689c1Smrg</para> 788994689c1Smrg</sect4> 789994689c1Smrg</sect3> 790994689c1Smrg</sect2> 791