Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

DwtPullDownMenuEntry(3Dwt)

Name

DwtPullDownMenuEntry, DwtPullDownMenuEntryCreate − Creates an instance of the pull-down menu entry widget. 

Syntax

Widget DwtPullDownMenuEntry(parent_widget, name,
                             x, y, label,
                             menu_id, callback, help_callback)
     Widget parent_widget;
     char *name;
     Position x, y;
     DwtCompString label;
     Widget menu_id;
     DwtCallbackPtr callback, help_callback;

Widget DwtPullDownMenuEntryCreate (parent_widget, name,
                                  override_arglist,
                                  override_argcount)
     Widget parent_widget;
     char *name;
     ArgList override_arglist;
     int override_argcount;

Arguments

parent_widget
Specifies the parent widget ID.

nameSpecifies the name of the created widget. 

xSpecifies the placement, in pixels, of the left side of the widget window relative to the inner upper left corner of the parent window.  This argument sets the DwtNx core widget attribute. 

ySpecifies, in pixels, the placement of the upper left corner of the widget window relative to the inner upper left corner of the parent window.  This argument sets the DwtNy core widget attribute. 

labelSpecifies the text of the label entry in the parent menu.  This argument sets the DwtNlabel attribute associated with DwtLabelCreate. 

menu_idSpecifies the ID of the pull-down menu widget. 

callbackSpecifies the callback function or functions called back when a button inside a pull-down menu entry widget is activated.  This argument sets the DwtNactivateCallback and DwtNpullingCallback attributes associated with DwtPullDownMenuEntryCreate. 

help_callbackSpecifies the callback function or functions called when a help request is made.  This argument sets the DwtNhelpCallback common widget attribute. 

parent_widget
Specifies the parent widget ID.

nameSpecifies the name of the created widget. 

override_arglist
Specifies the application override argument list.

override_argcount
Specifies the number of attributes in the application override argument list (override_arglist). 

Description

The DwtPullDownMenuEntry and DwtPullDownMenuEntryCreate functions create an instance of the pull-down menu entry widget and return its associated widget ID.  When calling DwtPullDownMenuEntry, you set the pull-down menu entry widget attributes presented in the formal parameter list.  For DwtPullDownMenuEntryCreate, however, you specify a list of attribute name/value pairs that represent all the possible pull-down menu entry widget attributes. 

A pull-down menu entry widget is made up of two parts: a label (within the parent menu) and a select area or “hotspot.” The hotspot is the full widget window.  Otherwise, the hotspot is a separate rectangle on the right side of the entry label. 

Inherited Attributes

Attribute Name Data Type Default
Core Attributes

DwtNx Position Determined by the geometry manager
DwtNy Position Determined by the geometry manager
DwtNwidth Dimension The DwtNlabel width, plus the DwtNhotSpotPixmap width or the DwtNpixmap width, plus DwtNmarginWidth times two
DwtNheight Dimension The DwtNlabel or DwtNpixmap height, plus DwtNmarginHeight times two
DwtNborderWidth Dimension zero pixels
DwtNborder Pixel Default foreground color
DwtNborderPixmap Pixmap NULL
DwtNbackground Pixel Default background color
DwtNbackgroundPixmap Pixmap NULL
DwtNcolormap Colormap Default color map
DwtNsensitive Boolean True
DwtNancestorSensitive Boolean The bitwise AND of the parent widget’s DwtNsensitive and DwtNancestorSensitive attributes
DwtNaccelerators XtTranslations NULL
DwtNdepth int Depth of the parent window
DwtNtranslations XtTranslations NULL
DwtNmappedWhenManaged Boolean True
DwtNscreen Screen * The parent screen
DwtNdestroyCallback DwtCallbackPtr NULL
Common Attributes

DwtNforeground Pixel Default foreground color
DwtNhighlight Pixel Default foreground color
DwtNhighlightPixmap Pixmap NULL
DwtNuserData Opaque * NULL
DwtNdirectionRToL unsigned char DwtDirectionRightDown
DwtNfont DwtFontList The default XUI Toolkit font
DwtNhelpCallback DwtCallbackPtr NULL
Label Attributes

DwtNlabelType unsigned char DwtCString
DwtNlabel DwtCompString Widget name
DwtNmarginWidth Dimension Two pixels for text
Zero pixels for pixmap
DwtNmarginHeight Dimension Two pixels for text
Zero pixels for pixmap
DwtNalignment unsigned char DwtAlignmentCenter
DwtNpixmap Pixmap NULL
DwtNmarginLeft Dimension Zero
DwtNmarginRight Dimension Zero
DwtNmarginTop Dimension Zero
DwtNmarginBottom Dimension Zero
DwtNconformToText Boolean True, if the widget is created with a width and height of zero
False, if the widget is created with a non-zero width and height

Widget-Specific Attributes

You can set the following widget-specifc attributes in the override_arglist:

Attribute Name Data Type Default
DwtNsubMenuId Widget NULL
DwtNactivateCallback DwtCallbackPtr NULL
DwtNpullingCallback DwtCallbackPtr NULL
DwtNhotSpotPixmap Pixmap NULL

DwtNsubMenuIdSpecifies the widget ID of the submenu that will be displayed when the pull-down menu is activated. 

DwtNactivateCallback
Specifies the callback that is executed when the user releases a button inside the pull-down menu widget. For this callback, the reason is DwtCRActivate. 

DwtNpullingCallback
Specifies the callback function or functions called just prior to pulling down the submenu. This callback occurs just before the submenu’s map callback. You can use this callback to defer the creation of the submenu. For this callback, the reason is DwtCRActivate. 

DwtNhotSpotPixmap
Specifies the pixmap to use for the hotspot icon.

Return Value

These functions return the ID of the created widget. 

Callback Information

The following structure is returned to your callback:

typedef struct {
int reason;
XEvent *event;
} DwtAnyCallbackStruct;

The reason member is set to a constant that represents the reason why this callback was invoked. For this callback, the reason member can be set to:

DwtCRActivate The user selected the pull-down menu entry. 
DwtCRHelpRequested The user selected Help. 

The event member is a pointer to the Xlib structure XEvent, which describes the event that generated this callback.  This structure is a union of the individual structures declared for each event type.  For information on XEvent and event processing, see the Guide to the Xlib Library: C Language Binding. 

See Also

Guide to the XUI Toolkit: C Language Binding
Guide to the XUI Toolkit Intrinsics: C Language Binding

Subroutines

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026