XMICONGADGET(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– XmIconGadget β€” the IconGadget widget class πŸ’–

okay so bestie, you're reading the manual page for XmIconGadget, and it lives in the library-call corner of the Motif docs. This is part 1 of 4, so don't you dare think we're done β€” we are so not done. Sit down, grab a snack πŸ“, and let's get into it.


✨ NAME ✨

XmIconGadget β€” the IconGadget widget class πŸ‘‘


🫢 SYNOPSIS 🫢

#include <Xm/IconG.h>

that's it. that's the whole include. slay. πŸ’…


🌸 DESCRIPTION 🌸

IconGadget is an instantiable widget whose whole personality is displaying text and a pixmap together in various combinations. It's giving versatility. Other widgets that hold the XmQTcontainer trait β€” like Container, hi bestie β€” can use IconGadget to represent objects.

IconGadget text is a compound string. If you don't supply any text, then the compound string gets generated from the gadget name instead. No text? no problem, it just makes one for you. And IconGadget text is placed relative to the type of associated pixmap.

Depending on the XmNviewType resource, IconGadget can display two views:

  • XmLARGE_ICON β€” the IconGadget text string is displayed below the pixmap, and centered. main character placement fr.
  • XmSMALL_ICON β€” the IconGadget text string is placed on the side of the small icon, in the widget's XmNlayoutDirection.

A bitmap mask can be supplied for each pixmap to clip the pixmap into some shape other than a rectangle. The XmNlargeIconMask and XmNsmallIconMask resources specify the large and small bitmap masks respectively. Visual emphasis for the IconGadget is provided with the XmNvisualEmphasis resource. IconGadget's XmNdetail and XmNdetailCount resources provide a detail view for IconGadgets, enabling the display of Strings alongside the IconGadget. The exact layout ordering of the strings depends on the associated containing widget β€” so like, ask them, not us. πŸ™ˆ

IconGadget uses the XmQTcontainer and XmQTspecifyRenderTable traits, and holds the XmQTcareParentVisual and XmQTcontainerItem traits.


πŸŽ€ Classes πŸŽ€

IconGadget inherits behaviour, resources, and traits from the Object, RectObject, and XmGadget classes. Family tree moment. 🌳

  • The class pointer is xmIconGadgetClass.
  • The class name is XmIconGadget.

🧾 New Resources ✨

The following 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.

πŸ’‘ pro tip for your .Xdefaults file: to reference a resource by name or by class, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). iykyk.

The codes in the access column mean: C = can be set at creation time, S = set by using XtSetValues, G = retrieved by using XtGetValues, N/A = not applicable.

Here's the whole XmIconGadget resource set, no cap, every single one of them:

  • Xmalignment β€” class XmCAlignment, type unsigned char, default XmALIGNMENT_CENTER, access CSG
  • XmNdetail β€” class XmCDetail, type XmStringTable, default NULL, access CSG
  • XmNdetailCount β€” class XmCDetailCount, type Cardinal, default 0, access CSG
  • XmNfontList β€” class XmCFontList, type XmFontList, default NULL, access CSG
  • XmNlabelString β€” class XmCXmString, type XmString, default dynamic, access CSG
  • XmNlargeIconMask β€” class XmCIconMask, type Pixmap, default dynamic, access CSG
  • XmNlargeIconPixmap β€” class XmCIconPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNmarginHeight β€” class XmCMarginHeight, type Dimension, default 2, access CSG
  • XmNmarginWidth β€” class XmCMarginWidth, type Dimension, default 2, access CSG
  • XmNrenderTable β€” class XmCRenderTable, type XmRenderTable, default dynamic, access CSG
  • XmNsmallIconMask β€” class XmCIconMask, type Pixmap, default dynamic, access CSG
  • XmNsmallIconPixmap β€” class XmCIconPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNviewType β€” class XmCViewType, type unsigned char, default XmLARGE_ICON, access CSG
  • XmNvisualEmphasis β€” class XmCVisualEmphasis, type unsigned char, default XmNOT_SELECTED, access CSG
  • XmNspacing β€” class XmCSpacing, type Dimension, default 4, access CSG

πŸ’… and here's what each one actually does πŸ’…

  • XmNalignment β€” specifies the horizontal alignment of the pixmap with respect to the label when the icon is in LARGE_ICON view. Valid values are XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER, and XmALIGNMENT_END.
  • XmNdetail β€” specifies an array of XmStrings that are the detail information associated with the gadget.
  • XmNdetailCount β€” specifies the size of the XmNdetail array.
  • XmNfontList β€” specifies the font list associated with XmIconGadget. Heads up bestie, the font list is an obsolete construct β€” it's been superseded by the render table. It's only here for compatibility with earlier versions of Motif, and for applications that don't easily support render tables. The default font list is derived from the default render table, and if you specify both a font list and a render table, the render table takes precedence. periodt.
  • XmNlabelString β€” specifies the compound string. If this value is NULL, it is initialized by converting the name of the gadget to a compound string. Refer to XmString(3) for more info on the creation and structure of compound strings. πŸ¦‹
  • XmNlargeIconMask β€” specifies the icon mask used when XmNviewType is XmLARGE_ICON.
  • XmNlargeIconPixmap β€” specifies the pixmap when XmNviewType is XmLARGE_ICON. If this resource's value is XmUNSPECIFIED_PIXMAP, there is no pixmap. And if a large icon pixmap is specified, and if during conversion an associated mask can be fetched, then the XmNlargeIconMask resource is set to that mask. sneaky little auto-assign, iconic.
  • XmNmarginHeight β€” specifies the amount of vertical space between the highlight and the inside (pixmap and label).
  • XmNmarginWidth β€” specifies the amount of horizontal space between the highlight and the inside (pixmap and label).

  • XmNrenderTable β€” okay so this one is the whole XmRenderTable vibe for the text used in the gadget. If XmNrenderTable is NULL when the IconGadget is created, the parent's render table resource value is used if there is a render table. If the parent does not have a render table, the parent hierarchy of the widget is searched for a widget that holds the XmQTspecifyRenderTable trait. If such an ancestor is found, the render table is initialized to the XmLABEL_RENDER_TABLE value of the ancestor widget. If no such widget is found, the default is implementation dependent. Refer to XmRenderTable(3) for more information on the creation and structure of a XmRenderTable. If both a render table and a font list are specified, the render table will take precedence. periodt πŸ’…
  • XmNsmallIconMask β€” bestie, this specifies the icon mask used when XmNviewType is XmSMALL_ICON. ✨
  • XmNsmallIconPixmap β€” specifies the pixmap when XmNviewType is XmSMALL_ICON. If this resource's value is XmUNSPECIFIED_PIXMAP, there is no pixmap. If a small icon pixmap is specified, and if during conversion an associated mask can be fetched, then the XmNsmallIconMask resource is set to that mask. iykyk πŸ¦‹
  • XmNspacing β€” this is the amount of space between the pixmap and the label parts of the icon. 🌸
  • XmNviewType β€” specifies the view (combination of pixmaps/text) that will be displayed. If the IconGadget is a child of a Container widget, however, then the specification of this resource will be taken from the Containerβ€” if Container's XmNentryViewType is either XmLARGE_ICON or XmSMALL_ICON, then IconGadget's XmNviewType takes that value; otherwise, the default is XmLARGE_ICON. This resource is set to one of the following:
    • XmLARGE_ICON β€” the pixmap specified by XmNlargeIconPixmap is displayed with the XmNlabelString beneath it. πŸ‘‘
    • XmSMALL_ICON β€” the pixmap specified by XmNsmallIconPixmap is displayed with the XmNlabelString displayed in the direction of the XmNlayoutDirection resource. 🌈
  • XmNvisualEmphasis β€” specifies the visual state of the IconGadget. If the IconGadget is in a selected state all visuals are displayed using the Container XmNselectColor resource. It is set to one of the following:
    • XmSELECTED β€” the IconGadget is in the selected state and displays the appropriate visuals. πŸ’š
    • XmNOT_SELECTED β€” the IconGadget is not in the selected state. πŸ’€

✨ Inherited Resources ✨

okay so listen πŸ’– IconGadget doesn't just come up with its whole personality on its own β€” it inherits behavior and resources from its superclasses, and they're all laid out in the tables below. For the full tea on any single resource, go read the reference page for that superclass, bestie, because it's giving details.

The access codes in that last column are listed exactly as they come, no cap β€” I'm not out here guessing what each letter means, the superclass pages spill that themselves πŸ’…


πŸŽ€ XmGadget Resource Set πŸŽ€

This is the whole glow-up your gadget gets handed down from XmGadget:

  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default dynamic, access CSG
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG
  • 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
  • XmNlayoutDirection β€” class XmNCLayoutDirection, type XmDirection, default dynamic, access CG
  • 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

πŸ¦‹ RectObj Resource Set πŸ¦‹

and then RectObj rolls up with its own lil' set, the geometry-flavored lore:

  • XmNancestorSensitive β€” class XmCSensitive, type Boolean, default dynamic, access G
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access N/A
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, 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

and yes, dynamic showing up everywhere means the default isn't just one fixed number sitting there β€” it's vibing, it gets worked out for you 🌈 and XmNborderWidth straight up has access N/A, so that's a whole situation, we don't touch it πŸ’€

still more coming, don't go anywhere 🫢

  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C πŸ’– (this one's the last row of the Object Resource Set table bestie, and it's the callback that fires when your gadget gets destroyed β€” iconic little goodbye moment ✨)

🌸 Additional Behavior 🌸

okay so real talk: IconGadget has no behavior. that's it. that's the whole thing. no behaviors. zero. none. she just sits there being a gadget πŸ’…


πŸ¦‹ Virtual Bindings πŸ¦‹

the bindings for virtual keys are vendor specific β€” meaning it's giving "ask your vendor, not me" energy fr fr 😭

for the tea on bindings for virtual buttons and keys, go read VirtualBindings(3) πŸ‘‘


πŸ’€ Errors/Warnings πŸ’€

the toolkit will display a warning if you give it an incorrect value for an enumeration resource 🚨

so like… don't do that. or do, and get warned. your choice bestie 🫢


the whole friend group, no cap:


and that's a wrap on the whole page, bestie!! πŸŽ€ this one came to you from XmIconGadget(library call) β€” go forth and gadget responsibly, you absolute icon πŸ‘‘βœ¨πŸ’–