CORE(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

✨ Core β€” the Core widget class ✨

okay bestie, this is Core(library call), the literal blueprint of the whole widget world, and I'm gonna walk you through it πŸ’–


🌸 SYNOPSIS 🌸

#include <Xm/Xm.h>

πŸ’… DESCRIPTION πŸ’…

okay so Core is the Xt Intrinsic base class for windowed widgets. like, if a widget has a window, Core is its ancestor. no cap.

and the Object and RectObj classes? those are the ones that give you support for windowless widgets. different vibe, still iconic. πŸ¦‹


πŸŽ€ Classes πŸŽ€

All widgets are built from Core. every single one. the way that literally everything descends from this? main character energy fr fr. πŸ‘‘

  • the class pointer is widgetClass
  • the class name is Core

🧚 New Resources 🧚

so the table below defines a set of widget resources that you (the programmer, yes you, hi 🫢) use to specify data. you can also set the resource values for the inherited classes to set attributes for this widget, so don't forget your ancestors.

here's the lil trick for .Xdefaults files, and it's giving cheat code:

  • to reference a resource by name or by class in a .Xdefaults file, 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) ⚠️

and the codes in the access column? they tell you exactly what you're allowed to do with each resource, and they mean:

  • C β€” it can be set at creation time
  • S β€” it can be set by using XtSetValues
  • G β€” it can be retrieved by using XtGetValues
  • N/A β€” not applicable, so don't even try it

πŸ‘‘ 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 1, 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 πŸ’«

okay that's the resource set, and there is so much more coming, part 2 is right there bestie, don't go anywhere 🌈

  • XmNaccelerators β€” bestie this one holds a translation table that's bound with its actions in the context of one specific widget. Then you can install that whole accelerator table on some destination widget. ⚠️ heads up tho: the default accelerators for any widget are always installed, no matter whether you specify this resource or not. Like, they're showing up regardless. periodt.
  • XmNancestorSensitive β€” says whether the widget's immediate parent receives input events. If you wanna change this argument, use XtSetSensitive so your data integrity stays intact (peep XmNsensitive for the tea). For shells: default is copied from the parent's XmNancestorSensitive resource if there is a parent; if there isn't, it's True. For other widgets: default is the bitwise AND of the parent's XmNsensitive and XmNancestorSensitive resources. πŸ’…
  • XmNbackground β€” the background color for the widget. that's it, that's the resource ✨
  • XmNbackgroundPixmap β€” a pixmap for tiling the background. The first tile gets placed at the upper left corner of the widget's window. πŸŽ€
  • XmNborderColor β€” the color of the border, given as a pixel value.
  • XmNborderPixmap β€” a pixmap used for tiling the border. First tile goes at the upper left corner of the border. πŸ¦‹
  • XmNborderWidth β€” how wide the border is that surrounds the widget's window on all four sides, in pixels. A width of 0 (zero) means no border shows at all. πŸ‘€ but fr fr, you should be using resources like XmNshadowThickness and XmNhighlightThickness instead of XmNborderWidth to specify border widths. like, that's the move.
  • XmNcolormap β€” the colormap used for conversions to the type Pixel for this widget instance. When you change this resource, previously generated pixel values are not affected, but newly generated values live in the new colormap. For shells without parents, the default is the default colormap of the widget's screen. Otherwise, the default is copied from the parent.
  • XmNdepth β€” the number of bits that can be used for each pixel in the widget's window. 🚨 Applications should not change or set this one β€” it's set by the Xt Intrinsics when the widget gets created. For shells without parents, the default is the default depth of the widget's screen. Otherwise, the default is copied from the parent.
  • XmNdestroyCallback β€” a list of callbacks that gets called when the widget is destroyed. rip to that widget 🫑
  • XmNheight β€” the inside height (border not included) of the widget's window.
  • XmNinitialResourcesPersistent β€” whether resources are reference counted or not. If the value is True when the widget is created, the resources referenced by the widget are not reference counted, no matter how the resource type converter is registered. If your app expects to destroy the widget and wants resources deallocated, specify False. Default is True, which implies the assumption that the widget won't be destroyed during the life of the application. ✨
  • XmNmappedWhenManaged β€” if this is set to True, it maps the widget (aka makes it visible) as soon as it's both realized and managed. If it's False, then the client is responsible for mapping and unmapping the widget. And if you flip it from True to False after the widget has been realized and managed, the widget gets unmapped. πŸ’€
  • XmNscreen β€” the screen on which a widget instance resides. It's read only, so don't even try it. When the Toolkit is initialized, the top-level widget gets its default value from the default screen of the display. Otherwise, the default is copied from the parent.
  • XmNsensitive β€” decides whether a widget receives input events. If a widget is sensitive, the Xt Intrinsics' Event Manager dispatches to it all keyboard, mouse button, motion, window enter/leave, and focus events. Insensitive widgets don't receive any of those. Use the function XtSetSensitive to change the sensitivity argument β€” and using XtSetSensitive is the whole point, because it makes sure that if a parent widget has XmNsensitive set to False, the ancestor-sensitive flag of all its children gets appropriately set. that's the queen bee energy right there πŸ‘‘
  • XmNtranslations β€” points to a translations list. A translations list is a list of events and actions that are to be performed when the events occur. ⚠️ and again: the default translations for any widget will always be installed, no matter whether this resource is specified or not. they're not going anywhere bestie.
  • XmNwidth β€” the inside width (border not included) of the widget's window.
  • XmNx β€” the x-coordinate of the upper left outside corner of the widget's window. The value is relative to the upper left inside corner of the parent window.
  • XmNy β€” the y-coordinate of the upper left outside corner of the widget's window. The value is relative to the upper left inside corner of the parent window.

🧚 Translations 🧚

There are no translations for Core. that's the whole section. nothing. zero. empty. a vibe check with no vibes 😭 (iykyk)


Object(3) and RectObj(3). go read those next, they're part of the family 🫢


and that's the whole Core page bestie!! 🌸✨ this one's from the Core(library call) collection β€” no date stamp on this one, just the source, so consider this your official sign-off: you ate that, now go build something iconic πŸ’–πŸŽ€πŸ’