SgDynaMenu(3X)SgDynaMenu(3X)NAMESgDynaMenu — The DynaMenu widget class
SYNOPSIS
#include <Sgm/DynaMenu.h>
VERSION
This page documents the version of Sgm that accompanies Motif 1.2.
DESCRIPTION
The DynaMenu widget is packaged popup menu widget. The DynaMenu sup‐
ports dynamic changing of menu entries. Pressing mouse button 1 on the
DynaMenu pops up its menu. The DynaMenu looks like a PushButton, but
cannot be pushed-in. Like a PushButton, it can accept either a label
string or a pixmap. Currently, however, you must have access to the
private instance record to set the string or pixmap.
Classes
DynaMenu inherits behavior and resources from Core, Composite, Con‐
straint, and XmManager.
The class pointer is sgDynaMenuWidgetClass.
The class name is SgDynaMenu.
New Resources
The following table defines a set of widget resources used by the pro‐
grammer to specify data. The programmer can also set the resource val‐
ues for the inherited classes to set attributes for this widget. To
reference a resource by name or by class in a .Xdefaults file, remove
the SgN or SgC prefix and use the remaining letters. To specify one of
the defined values for a resource in a .Xdefaults file, remove the Sg
prefix and use the remaining letters (in either lowercase or uppercase,
but include any underscores between words). The codes in the access
column indicate if the given resource can be set at creation time (C),
set by using XtSetValues (S), retrieved by using XtGetValues (G), or is
not applicable (N/A).
SgDynaMenu Resource Set
Name Class Type Default Access
───────────────────────────────────────────────────────────────────────────
SgNdynaPushCallback XmCCallback XtCallbackList NULL C
SgNhistoryListItems XmCItems XmStringTable NULL CSG
SgNhistoryListItemCount XmCItemCount int 0 CSG
SgNmaxHistoryCount XmCItemCount int 6 CG
The items in the history menu. These can be initialized to some set of
strings which are useful to the user. If left empty, the pulldown menu
will be very small and have nothing in it. The number of items in the
list should always match up with the number in SgNhistoryListItemCount.
The widget makes a copy of the list items, so the programmer is respon‐
sible for XmStringFree'ing the list provided to widget in a SetValues.
The number of items in the history list. This number should be at most
SgNmaxHistoryCount. An error may result if this number is set to some‐
thing different than the number of items in the SgNhistoryListItems or
if it is greater than SgNmaxHistoryCount. The maximum number of items
in the history list. This resource cannot be changed after widget cre‐
ation. It defaults to 6. If more than SgNmaxHistoryCount items are
given to the list, only the first SgNmaxHistoryCount are kept. If an
item is added to a full list, the last item on the list (the least
recently used item) is dropped out.
Inherited Resources
DynaMenu inherits behavior and resources from Core, Composite, Con‐
straint, and XmManager.
XmManager Resource Set
Name Class Type Default Access
──────────────────────────────────────────────────────────────────────────────────────────────────
XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic CSG
XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNforeground XmCForeground Pixel dynamic CSG
XmNhelpCallback XmCCallback XtCallbackList NULL C
XmNhighlightColor XmCHighlightColor Pixel dynamic CSG
XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG
XmNinitialFocus XmCInitialFocus Widget dynamic CSG
XmNnavigationType XmCNavigationType XmNavigationType XmTAB_GROUP CSG
XmNshadowThickness XmCShadowThickness Dimension dynamic CSG
XmNstringDirection XmCStringDirection XmStringDirection dynamic CG
XmNtopShadowColor XmCTopShadowColor Pixel dynamic CSG
XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG
XmNtraversalOn XmCTraversalOn Boolean True CSG
XmNunitType XmCUnitType unsigned char dynamic CSG
XmNuserData XmCUserData XtPointer NULL CSG
Composite Resource Set
Name Class Type Default Access
───────────────────────────────────────────────────────────────────────
XmNchildren XmCReadOnly WidgetList NULL G
XmNinsertPosition XmCInsertPosition XtOrderProc NULL CSG
XmNnumChildren XmCReadOnly Cardinal 0 G
Core Resource Set
Name Class Type Default Access
───────────────────────────────────────────────────────────────────────────────────────────────────────────────
XmNaccelerators XmCAccelerators XtAccelerators dynamic N/A
XmNancestorSensitive XmCSensitive Boolean dynamic G
XmNbackground XmCBackground Pixel dynamic CSG
XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG
XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderWidth XmCBorderWidth Dimension 0 CSG
XmNcolormap XmCColormap Colormap dynamic CG
XmNdepth XmCDepth int dynamic CG
XmNdestroyCallback XmCCallback XtCallbackList NULL C
XmNheight XmCHeight Dimension dynamic CSG
XmNinitialResourcesPersistent XmCInitialResourcesPersistent Boolean True C
XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG
XmNscreen XmCScreen Screen * dynamic CG
XmNsensitive XmCSensitive Boolean True CSG
XmNtranslations XmCTranslations XtTranslations dynamic CSG
XmNwidth XmCWidth Dimension dynamic CSG
XmNx XmCPosition Position 0 CSG
XmNy XmCPosition Position 0 CSG
Callback Information
The Callback structure is SgDynaMenuCallbackStruct. A pointer to the
following structure is passed to each callback: typedef struct {
int reason; XEvent * event; int button_number; }
SgDynaMenuCallbackStruct; Indicates why the callback was invoked. For a
push on menu button, the reason will be SgCR_DYNA_PUSH. Points to the
XEvent that triggered the callback Specifies the button which was
pressed. Range is from 0 to SgNhistoryListItemsCount - 1.
RELATED INFORMATIONCore(3X), SgCreateDynaMenu(3X), SgDynaMenuAddHistoryItem(3X), SgDyna‐
MenuClearHistory(3X), SgDynaMenuRemoveHistoryItem(3X),
SgDynaMenu(3X)