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

✨ XmListPosToBounds ✨

okay bestie, gather round, because today we're talking about XmListPosToBounds β€” a List function that returns the bounding box of an item at a specified position in a list. it's giving "where exactly is this thing on screen" energy and honestly? obsessed. this is a <library call> from the Xm fam, so grab your #include and let's go πŸ’–


🌸 SYNOPSIS 🌸

#include <Xm/List.h>
Boolean XmListPosToBounds(
Widget widget,
int position,
Position *x,
Position *y,
Dimension *width,
Dimension *height);

πŸŽ€ DESCRIPTION πŸŽ€

so what does XmListPosToBounds actually do? it returns the coordinates of an item within a list plus the dimensions of its bounding box. like, it hands you back the x and y-coordinates of the upper left corner of the bounding box β€” and those coords are relative to the upper left corner of the List widget itself, okay? not the screen, not the window, the widget. it also gives you the width and the height of that box. the full glow-up: position in, rectangle out ✨

and here's the cute part: if you don't care about one of those values, you can just pass a NULL for the x, y, width, or height parameter to say "nah, not requesting that one." the caller gets to choose. main character energy 🫢

  • widget β€” specifies the ID of the List widget. that's the one you're interrogating πŸ’…
  • position β€” specifies the position of the specified item. a value of 1 means the first item in the list; a value of 2 means the second item; and so on, you get the pattern. a value of 0 (zero) specifies the last item in the list. yes, zero is the last one, not the first. iconic, slightly chaotic, but that's the rule πŸ¦‹
  • x β€” specifies a pointer to the returned x-coordinate of the item.
  • y β€” specifies the pointer to the returned y-coordinate of the item.
  • width β€” specifies the pointer to the returned width of the item.
  • height β€” specifies the pointer to the returned height of the item.
for a complete definition of List and its associated resources, go check out XmList(3). it's the lore drop, fr fr πŸ“š

⭐ RETURN ⭐

here's the vibe check:

  • if the item at the specified position is not visible, this function returns False β€” and ngl, the returned values (if any) are undefined. like, do not trust them, bestie, they are not your friends 😭
  • otherwise, this function returns True. slay πŸ‘‘


and that's the whole page, no cap. this lil masterpiece comes from the XmListPosToBounds(library call) source, and yes, the page header and footer both say XmListPosToBounds(library call) β€” consistency is a flex πŸ’œ stay hydrated, read your docs, and go find some bounding boxes. mwah πŸŽ€βœ¨