SimpleMenu Widget
Application Header file <X11/Xaw/SimpleMenu.h>
Class Header file <X11/Xaw/SimpleMenP.h>
Class simpleMenuWidgetClass
Class Name SimpleMenu
Superclass OverrideShell
The SimpleMenu widget is a container for the menu entries. It is a
direct subclass of shell, and is should be created with
XtCreatePopupShell, not . This is the
only part of the menu that
actually is associated with a window. The SimpleMenu serves as the glue to bind
the individual menu entries together into a menu.
Resources
The resources associated with the SimpleMenu widget control aspects
that will affect the entire menu.
Name
Class
Type
Notes
Default Value
accelerators
Accelerators
AcceleratorTable
NULL
ancestorSensitive
AncestorSensitive
Boolean
D
True
allowShellResize
AllowShellResize
Boolean
True
background
Background
Pixel
XtDefaultBackground
backgroundPixmap
Pixmap
Pixmap
XtUnspecifiedPixmap
backingStore
BackingStore
BackingStore
see below
borderColor
BorderColor
Pixel
XtDefaultForeground
borderPixmap
Pixmap
Pixmap
XtUnspecifiedPixmap
borderWidth
BorderWidth
Dimension
1
bottomMargin
VerticalMargins
Dimension
0
children
ReadOnly
WidgetList
R
NULL
createPopupChildProc
CreatePopupChildProc
Function
NULL
colormap
Colormap
Colormap
Parent's Colormap
cursor
Cursor
Cursor
None
depth
Depth
int
C
Parent's Depth
destroyCallback
Callback
XtCallbackList
NULL
geometry
Geometry
String
NULL
height
Height
Dimension
Enough space to contain all entries
label
Label
String
NULL
labelClass
LabelClass
Pointer
SmeBSBObjectClass
mappedWhenManaged
MappedWhenManaged
Boolean
True
menuOnScreen
MenuOnScreen
Boolean
True
numChildren
ReadOnly
Cardinal
R
0
overrideRedirect
OverrideRedirect
Boolean
True
popdownCallback
Callback
XtCallbackList
NULL
popupCallback
Callback
XtCallbackList
NULL
popupOnEntry
PopupOnEntry
Widget
A
Label or first entry
rowHeight
RowHeight
Dimension
0
saveUnder
SaveUnder
Boolean
False
screen
Screen
Screen
R
Parent's Screen
sensitive
Sensitive
Boolean
True
topMargin
VerticalMargins
Dimension
0
translations
Translations
TranslationTable
See below
visual
Visual
Visual
CopyFromParent
width
Width
Dimension
Width of widest entry
x
Position
Position
0
y
Position
Position
0
backingStore
Determines what type of backing store will be used for the menu. Legal
values for this resource are NotUseful, WhenMapped, and
Always. These values are the backing-store integers defined in
<X11/X.h>.
If default is specified (the default behavior) the server will use
whatever it thinks is appropriate.
bottomMargin
topMargin
The amount of space between the top or bottom of the menu and the menu entry
closest to that edge.
cursor
The shape of the mouse pointer whenever it is in this widget.
geometry
If this resource is specified it will override the x, y, width and
height of this widget. The format of this string is
[<width>x<height>][{+ -} <xoffset> {+ -}<yoffset>].
label
This label will be placed at the top of the SimpleMenu, and may not be
highlighted. The name of the
label object is menuLabel. Using this name it is possible to
modify the label's attributes through the resource database. When the label
is created, the label is hard coded to the value of label, and
justify is hard coded as XtJustifyCenter.
labelClass
Specifies the type of Sme object created as the menu label.
menuOnScreen
If the menu is automatically positioned under the cursor with the
XawPositionSimpleMenu action, and this resource is True,
then the menu will always be fully visible on the screen.
overrideRedirect
Determines the value of the override_redirect attribute of the
SimpleMenu's window. The override_redirect attribute of a window
determines whether or not a window manager may interpose itself between
this window and the root window of the display. For more information
see the Interclient Communications Conventions Manual.
popdownCallback
popupCallback
These callback functions are called by the Xt Intrinsics whenever the
shell is popped up or down (See (xT for details).
popupOnEntry
The XawPositionSimpleMenu action will, by default, popup the
SimpleMenu with its label (or first entry) directly under the
pointer. To popup the menu under
another entry, set this resource to the menu entry that should be
under the pointer, when the menu is popped up. This allows the
application to offer the user a default menu entry that can be selected
with out moving the pointer.
rowHeight
If this resources is zero (the default) then each menu entry will be
given its desired height. If this resource has any other value then
all menu entries will be forced to be rowHeight pixels high.
saveUnder
If this is True then save unders will be active on the menu's window.
Convenience Routines
Registering the Global Action Routines
The XawPositionSimpleMenu action routine may often be invoked
before any menus have been created. This can occur when an
application uses dynamic menu creation. In these cases an application will
need to register this global action routine by calling
:
app_con
Specifies the application context in which this action should be registered.
This function need only be called once per application and must be
called before any widget that uses XawPositionSimpleMenu action
is realized.
Getting and Clearing the Current Menu Entry
To get the currently highlighted menu entry use
:
w
Specifies the SimpleMenu widget.
This function returns the menu entry that is
currently highlighted, or NULL if no entry is highlighted.
To clear the SimpleMenu widget's internal information about the
currently highlighted menu entry use
:
w
Specifies the SimpleMenu widget.
This function unsets all internal references to the currently
highlighted menu entry. It does not unhighlight or otherwise
alter the appearance of the active entry. This function is primarily
for use by implementors of menu entries.