DTCOMBOBOX(3)

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

🫢 NAME 🫢

DtComboBox β€” the ComboBox widget class. Hi bestie! You’re in the library call manual, and the header energy is literally DtComboBox(library call) πŸ’…βœ¨.

🌸 SYNOPSIS 🌸

#include &<Dt/ComboBox.h>

✨ DESCRIPTION ✨

Note: This function has been superseded by the equivalent Motif function XmComboBox. Please refer to the Motif Programmer’s Reference for more information.

The DtComboBox widget is a combination of a TextField and a List widget that gives the TextField a list of valid choices. Selecting an item from this list automatically fills in the TextField with that list item. It’s giving β€œautocomplete but make it Motif” πŸ’–.

Widget subclassing is not supported for the DtComboBox widget class. No cap, that’s just the rule 😭.

The resources for the XmList and XmTextField widgets that are created by the DtComboBox are accessible by using the XtNameToWidget(3) function. The names of these widgets are *List and Text, respectively. (The *List notation is required because the List widget is not an immediate descendant of the DtComboBox. See XtNameToWidget(3).) πŸ‘‘

🧸 Classes 🧸

The DtComboBox widget inherits behavior and resources from the Core, Composite and XmManager classes.

  • The class pointer is dtComboBoxWidgetClass.
  • The class name is DtComboBoxWidget.

πŸ›οΈ 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). 🫢

DtComboBox Resource Set

  • DtNmarginHeight β€” class DtCMarginHeight, type Dimension, default 2, access CSG. Specifies the number of pixels added between the top and bottom of the text widget and the start of the shadow.
  • DtNmarginWidth β€” class DtCMarginWidth, type Dimension, default 2, access CSG. Specifies the number of pixels added between the right and left sides of the text widget and the start of the shadow.
  • DtNselectedItem β€” class DtCSelectedItem, type XmString, default dynamic, access CSG. This resource is passed through to the XmList to set the XmNselectedItemCount and XmNselectedItems as the single item in the XmNitems that matches this specified XmString in the List. Setting both DtNselectedItem and DtNselectedPosition in the same argument list produces undefined behavior. ⚠️
  • DtNselectedPosition β€” class DtCSelectedPosition, type int, default dynamic, access CSG. This resource is passed through to the XmList to set the XmNselectedItemCount and XmNselectedItems as the single item at this specified position in the List. Setting both DtNselectedItem and DtNselectedPosition in the same argument list produces undefined behavior. ⚠️
  • DtNselectionCallback β€” class DtCCallback, type XtCallbackList, default NULL, access C. This callback list is issued when an item is selected from the DtComboBox widget’s List. The call_data structure contains a DtComboBoxCallbackStruct with the reason DtCR_SELECT.
  • DtNcomboBoxType β€” class DtCComboBoxType, type unsigned int, default DtDROP_DOWN_LIST, access C. This resource determines the style of the DtComboBox. There are two choices:
    • DtDROP_DOWN_COMBO_BOX β€” Provides an editable text area.
    • DtDROP_DOWN_LIST β€” Provides a static text area.
Table-artifact corner πŸ’€: yes, the original also has tgroup dispwid="7.46in" in this chunk. Keeping the formatting gremlins accounted for.

🧚 Inherited Resources 🧚

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

XmManager 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.
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG.
  • XmNinitialFocus β€” class XmCInitialFocus, type Widget, default NULL, access CSG.
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default dynamic, access CSG.
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default dynamic, access CSG.
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CG.
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG.
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG.
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default dynamic, access CSG.
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG.
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG.
More artifact realness: tgroup dispwid="7.73in" lives here too 🫠.

Composite Resource Set

  • XmNchildren β€” class XmCReadOnly, type WidgetList, default NULL, access G.
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default default procedure, access CSG.
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G.
Artifact check πŸŽ€: tgroup dispwid="7.46in".

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. (The original row starts with the tiny artifact row rht="0.39in" before XmNscreen, for the completionists πŸ’€.)
  • 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.
Final artifact from the Core chunk: tgroup dispwid="7.85in"Caret with a stray Caret at the end. Not me preserving the gremlins, but I am πŸ’….

πŸ¦‹ Callback Information πŸ¦‹

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

typedef struct {
        int             reason;
        XEvent          *event;
        XmString        item_or_text;
        int             item_position;
} DtComboBoxCallbackStruct;

The reason argument indicates why the callback was invoked; it is always DtCR_SELECT.

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

The item_or_text argument is the contents of the Text widget at the time the event caused the callback to be invoked. This data is only valid within the scope of the call_data structure, so the application must copy it when it is used outside of this scope. Copy it, bestie β€” do not rawdog that pointer 😭.

The item_position argument is the new value of the DtNselectedPosition resource in the DtComboBox’s List. If this is zero, it means the user entered a value in the XmTextField widget.

πŸ”₯ SEE ALSO πŸ”₯

DtComboBoxAddItem(3), DtComboBoxDeletePos(3), DtComboBoxSelectItem(3), DtComboBoxSetItem(3), DtCreateComboBox(3), Composite(3), Constraint(3), Core(3), XmList(3), XmManager(3), XmText(3), XmTextField(3), XtGetValues(3), XtSetValues(3).


Ok bye bestie 🫢 This page signs off as DtComboBox(library call) β€” no separate source/version/date line is listed on this one, so that’s the whole cute footer situation. Stay slay, don’t set both selected resources in one argument list, and may your text fields stay fillable πŸ‘‘βœ¨πŸ’–.

πŸ“¦ where this page comes from