SgDynaMenu(3X) UNIX System V SgDynaMenu(3X)
NAME
SgDynaMenu - 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 supports 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, Constraint, 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 programmer to specify data. The programmer can also
set the resource values 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
Page 1 (printed 4/30/98)
SgDynaMenu(3X) UNIX System V SgDynaMenu(3X)
SgNhistoryListItems
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
responsible for XmStringFree'ing the list provided
to widget in a SetValues.
SgNhistoryListItemCount
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
something different than the number of items in
the SgNhistoryListItems or if it is greater than
SgNmaxHistoryCount.
SgNmaxHistoryCount
The maximum number of items in the history list.
This resource cannot be changed after widget
creation. 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, Constraint, 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
Page 2 (printed 4/30/98)
SgDynaMenu(3X) UNIX System V SgDynaMenu(3X)
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;
reason Indicates why the callback was invoked. For a push
on menu button, the reason will be SgCR_DYNA_PUSH.
event Points to the XEvent that triggered the callback
Page 3 (printed 4/30/98)
SgDynaMenu(3X) UNIX System V SgDynaMenu(3X)
button_number
Specifies the button which was pressed. Range is
from 0 to SgNhistoryListItemsCount - 1.
RELATED INFORMATION
Core(3X), SgCreateDynaMenu(3X),
SgDynaMenuAddHistoryItem(3X), SgDynaMenuClearHistory(3X),
Page 4 (printed 4/30/98)