XMICONGADGET(3)
π 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β theIconGadgettext string is displayed below the pixmap, and centered. main character placement fr.XmSMALL_ICONβ theIconGadgettext string is placed on the side of the small icon, in the widget'sXmNlayoutDirection.
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.Xdefaultsfile: to reference a resource by name or by class, remove theXmNorXmCprefix and use the remaining letters. To specify one of the defined values for a resource in a.Xdefaultsfile, remove theXmprefix 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β classXmCAlignment, typeunsigned char, defaultXmALIGNMENT_CENTER, accessCSGXmNdetailβ classXmCDetail, typeXmStringTable, defaultNULL, accessCSGXmNdetailCountβ classXmCDetailCount, typeCardinal, default0, accessCSGXmNfontListβ classXmCFontList, typeXmFontList, defaultNULL, accessCSGXmNlabelStringβ classXmCXmString, typeXmString, defaultdynamic, accessCSGXmNlargeIconMaskβ classXmCIconMask, typePixmap, defaultdynamic, accessCSGXmNlargeIconPixmapβ classXmCIconPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNmarginHeightβ classXmCMarginHeight, typeDimension, default2, accessCSGXmNmarginWidthβ classXmCMarginWidth, typeDimension, default2, accessCSGXmNrenderTableβ classXmCRenderTable, typeXmRenderTable, defaultdynamic, accessCSGXmNsmallIconMaskβ classXmCIconMask, typePixmap, defaultdynamic, accessCSGXmNsmallIconPixmapβ classXmCIconPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNviewTypeβ classXmCViewType, typeunsigned char, defaultXmLARGE_ICON, accessCSGXmNvisualEmphasisβ classXmCVisualEmphasis, typeunsigned char, defaultXmNOT_SELECTED, accessCSGXmNspacingβ classXmCSpacing, typeDimension, default4, accessCSG
π 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 inLARGE_ICONview. Valid values areXmALIGNMENT_BEGINNING,XmALIGNMENT_CENTER, andXmALIGNMENT_END.XmNdetailβ specifies an array ofXmStrings that are the detail information associated with the gadget.XmNdetailCountβ specifies the size of theXmNdetailarray.XmNfontListβ specifies the font list associated withXmIconGadget. 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 isNULL, it is initialized by converting the name of the gadget to a compound string. Refer toXmString(3)for more info on the creation and structure of compound strings. π¦XmNlargeIconMaskβ specifies the icon mask used whenXmNviewTypeisXmLARGE_ICON.XmNlargeIconPixmapβ specifies the pixmap whenXmNviewTypeisXmLARGE_ICON. If this resource's value isXmUNSPECIFIED_PIXMAP, there is no pixmap. And if a large icon pixmap is specified, and if during conversion an associated mask can be fetched, then theXmNlargeIconMaskresource 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 wholeXmRenderTablevibe for the text used in the gadget. IfXmNrenderTableisNULLwhen 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 theXmQTspecifyRenderTabletrait. If such an ancestor is found, the render table is initialized to theXmLABEL_RENDER_TABLEvalue of the ancestor widget. If no such widget is found, the default is implementation dependent. Refer toXmRenderTable(3)for more information on the creation and structure of aXmRenderTable. 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 whenXmNviewTypeisXmSMALL_ICON. β¨XmNsmallIconPixmapβ specifies the pixmap whenXmNviewTypeisXmSMALL_ICON. If this resource's value isXmUNSPECIFIED_PIXMAP, there is no pixmap. If a small icon pixmap is specified, and if during conversion an associated mask can be fetched, then theXmNsmallIconMaskresource 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'sXmNentryViewTypeis eitherXmLARGE_ICONorXmSMALL_ICON, then IconGadget'sXmNviewTypetakes that value; otherwise, the default isXmLARGE_ICON. This resource is set to one of the following:XmLARGE_ICONβ the pixmap specified byXmNlargeIconPixmapis displayed with theXmNlabelStringbeneath it. πXmSMALL_ICONβ the pixmap specified byXmNsmallIconPixmapis displayed with theXmNlabelStringdisplayed in the direction of theXmNlayoutDirectionresource. π
XmNvisualEmphasisβ specifies the visual state of the IconGadget. If the IconGadget is in a selected state all visuals are displayed using the ContainerXmNselectColorresource. 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β classXmCBackground, typePixel, defaultdynamic, accessCSGXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSGXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultdynamic, accessCSGXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSGXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSGXmNhighlightOnEnterβ classXmCHighlightOnEnter, typeBoolean, defaultFalse, accessCSGXmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSGXmNhighlightThicknessβ classXmCHighlightThickness, typeDimension, default0, accessCSGXmNlayoutDirectionβ classXmNCLayoutDirection, typeXmDirection, defaultdynamic, accessCGXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmNONE, accessCSGXmNshadowThicknessβ classXmCShadowThickness, typeDimension, default0, accessCSGXmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSGXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSGXmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultFalse, accessCSGXmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSGXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG
π¦ RectObj Resource Set π¦
and then RectObj rolls up with its own lil' set, the geometry-flavored lore:
XmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessN/AXmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSGXmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSG
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β classXmCCallback, typeXtCallbackList, defaultNULL, accessCπ (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 π«Ά
π RELATED π
the whole friend group, no cap:
Core(3)XmContainer(3)XmCreateIconGadget(3)XmGadget(3)XmVaCreateIconGadget(3)XmVaCreateManagedIconGadget(3)
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 πβ¨π
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms