Tk_GetVRootGeometry(3tk)

πŸ“¦
version 9.0.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ Tk_GetVRootGeometry β€” get the location + size of your window's virtual root, bestie ✨

okay so real quick, this is a page from the Tk Library Procedures manual, and it's all about Tk_GetVRootGeometry πŸ’–


🌸 NAME 🌸

Tk_GetVRootGeometry β€” bestie, this one gets you the location and size of the virtual root for a window 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <tk.h>

Tk_GetVRootGeometry(tkwin, xPtr, yPtr, widthPtr, heightPtr)

πŸ¦‹ ARGUMENTS πŸ¦‹

  • Tk_Window tkwin (in) β€” the token for the window whose virtual root you wanna snoop on πŸ‘€
  • int xPtr (out) β€” points to the word where the x-offset of the virtual root gets dropped πŸ’…
  • int yPtr (out) β€” points to the word where the y-offset of the virtual root gets dropped πŸ’…
  • int widthPtr (out) β€” points to the word where the width of the virtual root gets dropped πŸ“
  • int heightPtr (out) β€” points to the word where the height of the virtual root gets dropped πŸ“

πŸ‘‘ DESCRIPTION πŸ‘‘

So Tk_GetVRootGeometry hands you back the geometry info about the virtual root window that's associated with tkwin. ✨

And when we say "associated"? We mean the virtual root that tkwin's nearest top-level ancestor got reparented into by the window manager. (Or tkwin itself, if tkwin is a top-level window β€” she's the main character in that case πŸ‘‘). This window gets identified by a __SWM_ROOT or __WM_ROOT property that the window manager places on the top-level window.

🫢 now here's the part where you gotta pay attention bestie β€” if tkwin is not associated with a virtual root (like, say, because your window manager simply does not do virtual roots), then *xPtr and *yPtr get set to 0, and *widthPtr and *heightPtr get set to the dimensions of the screen containing tkwin. That's the fallback, no cap. πŸ’€

πŸ’œ KEYWORDS πŸ’œ

geometry, height, location, virtual root, width, window manager


and that's the whole page, babe πŸ’– this was Tk 4.0, page Tk_GetVRootGeometry(3tk), from the Tk Library Procedures β€” slay, go get those virtual root coordinates πŸ§šπŸ’…πŸŒΈ

πŸ“¦ where this page comes from