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

πŸ’– XmDirection πŸ’–

okay bestie so this is a library call page, meaning it's documentation for the <Xm/Xm.h> crowd β€” the Motif girlies. and today's main character is XmDirection, the data type for the direction of widget components. yes she's a type, not a function, and she's carrying the whole layout of your app on her back. no biggie. πŸ’…


✨ SYNOPSIS ✨

#include <Xm/Xm.h>

that's it. that's the whole synopsis. she's low maintenance like that. πŸŽ€


🌸 DESCRIPTION 🌸

XmDirection is the data type that says which direction the system displays subwidgets, children of widgets, or literally any other visual components that are getting laid out. and not just for looks, okay β€” this type also affects traversal order within tab groups. so like, the order you tab through stuff? yeah, she decides that. main character energy fr. πŸ‘‘

here's the tea: XmDirection is implemented as an unsigned char bit mask. so the horizontal and vertical directions can be specified independent of each other β€” pick and choose, we love options. ✨

she ALSO specifies the precedence of the horizontal and vertical directions relative to each other. for example, a value of XmRIGHT_TO_LEFT_TOP_TO_BOTTOM lays out a component horizontally from right to left first, then vertically top to bottom. see how the name literally tells you the order? it's giving organized. it's giving i-have-my-life-together.

🧚 the single bit masks

XmDirection provides the following masks, each of which corresponds to a particular bit in XmDirection:

  • XmRIGHT_TO_LEFT_MASK
  • XmLEFT_TO_RIGHT_MASK
  • XmTOP_TO_BOTTOM_MASK
  • XmBOTTOM_TO_TOP_MASK
  • XmPRECEDENCE_HORIZ_MASK
  • XmPRECEDENCE_VERT_MASK

🌈 the multiple bit masks

in addition to the preceding single bit masks, XmDirection also provides the following multiple bit masks. these ones are particularly useful as arguments to XmDirectionMatchPartial β€” like, that's their whole moment, that's their calling:

  • XmHORIZONTAL_MASK
  • XmPRECEDENCE_MASK
  • XmVERTICAL_MASK

πŸ’œ the enumerated constants

Motif also provides the following enumerated constants for specifying various combinations of directions. let's go through them one by one, no skipping, we don't do that here:

  • XmRIGHT_TO_LEFT_TOP_TO_BOTTOM β€” specifies that the components are laid out from right to left first, then top to bottom.
  • XmLEFT_TO_RIGHT_TOP_TO_BOTTOM β€” specifies that the components are laid out from left to right first, then top to bottom.
  • XmRIGHT_TO_LEFT_BOTTOM_TO_TOP β€” specifies that the components are laid out from right to left first, then bottom to top.
  • XmLEFT_TO_RIGHT_BOTTOM_TO_TOP β€” specifies that the components are laid out from left to right first, then bottom to top.
  • XmTOP_TO_BOTTOM_RIGHT_TO_LEFT β€” specifies that the components are laid out from top to bottom first, then right to left.
  • XmTOP_TO_BOTTOM_LEFT_TO_RIGHT β€” specifies that the components are laid out from top to bottom first, then left to right.
  • XmBOTTOM_TO_TOP_RIGHT_TO_LEFT β€” specifies that the components are laid out from bottom to top first, then right to left.
  • XmBOTTOM_TO_TOP_LEFT_TO_RIGHT β€” specifies that the components are laid out from bottom to top first, then left to right.
  • XmTOP_TO_BOTTOM β€” specifies that the components are laid out from top to bottom. ⚠️ if horizontal direction is important, do not use this constant.
  • XmBOTTOM_TO_TOP β€” specifies that the components are laid out from bottom to top. ⚠️ if horizontal direction is important, do not use this constant.
  • XmDEFAULT_DIRECTION β€” specifies that the components are laid out according to the default direction. (this constant is primarily for widget writers, so if that's not you, it's not really your moment. 🫢)
  • XmLEFT_TO_RIGHT β€” specifies that the components are laid out from left to right. ⚠️ if vertical direction is important, do not use this constant.
  • XmRIGHT_TO_LEFT β€” specifies that the components are laid out from right to left. ⚠️ if vertical direction is important, do not use this constant.
okay real talk bestie: notice how XmTOP_TO_BOTTOM, XmBOTTOM_TO_TOP, XmLEFT_TO_RIGHT and XmRIGHT_TO_LEFT all come with a "do not use this constant if the other direction is important" warning? that's not a vibe, that's a fact, so respect it. if you care about both axes, pick one of the full combination constants instead. 🚫

she doesn't exist in a vacuum, she's got a whole friend group:


and that's the whole page, bestie!! πŸ¦‹ you now officially understand XmDirection β€” the bit mask with range, the direction diva, the tab-group traversal queen. slay. periodt. πŸ’…βœ¨

signing off from the XmDirection library call page, <rainbow>XmDirection(library call)</rainbow>, same title energy top and bottom because symmetry is iconic. mwah. πŸ’–πŸŽ€πŸŒΈ