DTMENUBUTTON(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

πŸ’– NAME πŸ’–

okay so this is DtMenuButton(3) β€” the DtMenuButton(library call) page, and the official name is DtMenuButton β€” the MenuButton widget class. She’s giving main character widget energy, fr fr πŸ‘‘.

✨ SYNOPSIS ✨

Include this and you’re seated, bestie:

#include &<Dt/MenuButton.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: DtMenuButton is a command widget that complements the menu cascading functionality of an XmCascadeButton widget. As a complement to the XmCascadeButton widget, DtMenuButton can only be instantiated outside a MenuPane; the application must use XmCascadeButton widget inside a MenuPane. That’s the rule, no cap 🫢.

The DtMenuButton widget belongs to a subclass of the XmLabel class. Visually, the DtMenuButton widget consists of a label string and a menu glyph. The menu glyph always appears on the right end of the widget and, by default, is a downward pointing arrow. Cute, consistent, iconic ✨.

The DtMenuButton widget has an implicitly created submenu attached to it. The submenu Caretis a popup MenuPane and has this DtMenuButton widget as its parent. The name of the implicitly created submenu is obtained by adding submenu_ as a prefix to the name of this DtMenuButton widget. The widget ID of the submenu can be obtained by doing an XtGetValues on the DtNsubMenuId resource of this DtMenuButton widget. The implicitly created submenu must not be destroyed by the user of this widget. Do not do it. Put the destroy down πŸ’€.

The submenu can be popped up by pressing the menu post Button (see the XmNmenuPost resource of the XmRowColumn(3) widget) anywhere on the DtMenuButton widget.

Widget subclassing is not supported for the DtMenuButton widget class. Periodt.

Classes 🫢

The DtMenuButton widget inherits behavior and resources from the Core, Composite, XmPrimitive and XmLabel classes.

  • The class pointer is dtMenuButtonWidgetClass.
  • The class name is DtMenuButtonWidget.

New Resources πŸŽ€

The following table defines a set of widget resources used by the application to specify data. The application 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, the application must remove the DtN or DtC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, the application must remove the Dt prefix and use the remaining letters (in either lower case or upper case, but including 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). Access-code vibe check: keep it exact, bestie πŸ’….

DtMenuButton Resource Set πŸ’–

  • DtNcascadingCallback β€” class DtCCallback, type XtCallbackList, default NULL, access C. Specifies the list of callbacks that is called before the popping up of the attached submenu. The reason for the callback is DtCR_CASCADING.
  • DtNcascadePixmap β€” class DtCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG. Specifies the pixmap displayed as the menu glyph. If no pixmap is specified, a downward pointing arrow is displayed.
  • DtNsubMenuId β€” class DtCMenuWidget, type Widget, default NULL, access SG. Specifies the widget ID of the popup MenuPane to be associated with this DtMenuButton widget. The popup MenuPane must be created with this DtMenuButton as its parent. This resource cannot be specified at the time of widget creation. The implicit submenu is automatically destroyed by DtMenuButton when this resource is set.

Source-table layout crumb, for the detail gremlins: tgroup dispwid="7.78in" β€” not a resource, just formatting glitter.

Inherited Resources 🌸

The DtMenuButton widget inherits behavior and resources from the following named superclasses. For a complete description of each resource, see the man page for that superclass.

XmLabel Resource Set 🌈

  • XmNaccelerator β€” class XmCAccelerator, type String, default NULL, access CSG.
  • XmNacceleratorText β€” class XmCAcceleratorText, type XmString, default NULL, access CSG.
  • XmNalignment β€” class XmCAlignment, type unsigned char, default dynamic, access CSG.
  • XmNfontList β€” class XmCFontList, type XmFontList, default dynamic, access CSG.
  • XmNlabelInsensitivePixmap β€” class XmCLabelInsensitivePixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNlabelPixmap β€” class XmCLabelPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNlabelString β€” class XmCXmString, type XmString, default dynamic, access CSG.
  • XmNlabelType β€” class XmCLabelType, type unsigned char, default XmSTRING, access CSG.
  • XmNmarginBottom β€” class XmCMarginBottom, type Dimension, default 0, access CSG.
  • XmNmarginHeight β€” class XmCMarginHeight, type Dimension, default 2, access CSG.
  • XmNmarginLeft β€” class XmCMarginLeft, type Dimension, default 0, access CSG.
  • XmNmarginRight β€” class XmCMarginRight, type Dimension, default 0, access CSG.
  • XmNmarginTop β€” class XmCMarginTop, type Dimension, default 0, access CSG.
  • XmNmarginWidth β€” class XmCMarginWidth, type Dimension, default 2, access CSG.
  • XmNmnemonic β€” class XmCMnemonic, type KeySym, default NULL, access CSG.
  • XmNmnemonicCharSet β€” class XmCMnemonicCharSet, type String, default XmFONTLIST-_DEFAULT_TAG, access CSG.
  • XmNrecomputeSize β€” class XmCRecomputeSize, type Boolean, default True, access CSG.
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CSG.

Source-table layout crumb: tgroup dispwid="7.84in" β€” still just formatting, not a resource.

XmPrimitive Resource Set πŸ¦‹

  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG.
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG.
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG.
  • XmNhighlightOnEnter β€” class XmCHighlightOnEnter, type Boolean, default False, access CSG.
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG.
  • XmNhighlightThickness β€” class XmCHighlightThickness, type Dimension, default 0, access CSG.
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmNONE, access CSG.
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default 0, access CSG.
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG.
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG.
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default False, access CSG.
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG.
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG.

Source-table layout crumb: tgroup dispwid="7.93in" β€” table glue, not widget behavior.

Core Resource Set πŸ‘‘

  • XmNaccelerators β€” class XmCAccelerators, type XtAccelerators, default dynamic, access CSG.
  • XmNancestorSensitive β€” class XmCSensitive, type Boolean, default dynamic, access G.
  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG.
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNborderColor β€” class XmCBorderColor, type Pixel, default XtDefaultForeground, access CSG.
  • XmNborderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access CSG.
  • XmNcolormap β€” class XmCColormap, type Colormap, default dynamic, access CG.
  • XmNdepth β€” class XmCDepth, type int, default dynamic, access CG.
  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG.
  • XmNinitialResourcesPersistent β€” class XmCInitialResourcesPersistent, type Boolean, default True, access C.
  • XmNmappedWhenManaged β€” class XmCMappedWhenManaged, type Boolean, default True, access CSG.
  • XmNscreen β€” class XmCScreen, type Screen *, default dynamic, access CG.
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, access CSG.
  • XmNtranslations β€” class XmCTranslations, type XtTranslations, default dynamic, access CSG.
  • XmNwidth β€” class XmCWidth, type Dimension, default dynamic, access CSG.
  • XmNx β€” class XmCPosition, type Position, default 0, access CSG.
  • XmNy β€” class XmCPosition, type Position, default 0, access CSG.

Source-table layout crumb: tgroup dispwid="7.85in" β€” just the table’s little outfit, not a resource.

Callback Information πŸŽ€

A pointer to the following structure is passed to each DtMenuButton callback:

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

The reason argument indicates why the callback was invoked; it is always DtCR_CASCADING when the DtNcascadingCallback is issued.

The event argument points to the XEvent that triggered the callback or NULL if the callback was not triggered by an XEvent.

🌈 SEE ALSO 🌈

Go read these next, bestie β€” the whole friend group:


Cute sign-off: this page is the DtMenuButton(library call) source/version line, and the footer did not print a date, so I’m not inventing one β€” no cap, periodt πŸ’…πŸ«Άβœ¨

πŸ“¦ where this page comes from