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

πŸ’– XmWidgetGetDisplayRect πŸ’–

okay bestie, gather round, because today we're talking about XmWidgetGetDisplayRect β€” a library call from the Xm fam (yes, that's the Motif toolkit, we love her) and she is here to spill the tea on where your widget's display rectangle actually lives. πŸŽ€


✨ NAME ✨

XmWidgetGetDisplayRect β€” retrieves display rectangle information for a widget πŸ¦‹


🌸 SYNOPSIS 🌸

#include <Xm/Xm.h>
Boolean XmWidgetGetDisplayRect(
Widget widget,
XRectangle *displayrect);

πŸ’… DESCRIPTION πŸ’…

so like. XmWidgetGetDisplayRect hands you back the width, the height, and the x and y-coordinates of the upper left corner of the display rectangle of whatever widget you point it at. and what IS a display rectangle, you ask? it's the smallest rectangle that encloses either a string or a pixmap. that's it. that's the whole vibe. it's giving bounding box energy, fr fr. πŸ“¦βœ¨

now here's the part where it gets specific, because she contains multitudes:

  • if the widget contains a string, the return values give you the x and y-coordinates of the upper left corner of the display rectangle, measured relative to the origin of the widget, plus the width and height in pixels. 🧚
  • in the case of a pixmap, the return values give you the x and y-coordinates of the upper left corner of the pixmap relative to the origin, and the width and height of the pixmap in pixels. πŸ–ΌοΈ

and here are the args, bestie, no skips:

  • widget β€” specifies the widget ID. the little guy you're asking about. πŸ‘‘
  • displayrect β€” specifies a pointer to an XRectangle structure, and this is where the x and y-coordinates, width and height of the display rectangle get returned. it's the lil container you're handing her to fill up. 🫢

⭐ RETURN ⭐

returns True if the specified widget has an associated display rectangle. otherwise? returns False. 😭 that's the whole deal. no notes.

ngl if you're not checking this return value you're doing it wrong, bestie. vibe check your booleans. βœ…


and that's the whole page, no cap. this lil legend lives in the library call section of the manual, filed right under her own name β€” XmWidgetGetDisplayRect(library call), the one and only. periodt. πŸ’…βœ¨πŸ¦‹

anyway ily, go forth and enclose some rectangles. πŸŽ€πŸŒΈ