Tk_GetVRootGeometry(3)

πŸ’… Tk_GetVRootGeometry πŸ’…

okay bestie, so this is a Tk Library Procedures page β€” like, the official one β€” and it's all about finding out where a "virtual root" window lives and how big it is. yes, virtual root. no, it's not a metaphor. stay with me 🫢


🌸 NAME 🌸

Tk_GetVRootGeometry β€” literally just: get 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 interrogate πŸ‘€
  • int xPtr (out) β€” points to the word where we're gonna stash the x-offset of the virtual root
  • int yPtr (out) β€” points to the word where the y-offset goes
  • int widthPtr (out) β€” points to the word that gets the virtual root's width
  • int heightPtr (out) β€” points to the word that gets the virtual root's height

✨ DESCRIPTION ✨

so Tk_GetVRootGeometry hands you back the geometry info for the virtual root window that's associated with tkwin. and which one is "associated", you ask? it's the virtual root that tkwin's nearest top-level ancestor got reparented into by the window manager β€” or, if tkwin is a top-level window itself, then it's tkwin's own associated virtual root. main character energy, honestly πŸ‘‘

how do we even find that window? the window manager tags it with a __SWM_ROOT or __WM_ROOT property on the top-level window. that's the receipt, iykyk πŸ’…

okay so here's the vibe check that matters: if tkwin is not associated with a virtual root (like, say, because the window manager just doesn't do virtual roots β€” some of them simply don't), then *xPtr and *yPtr get set to 0, and *widthPtr and *heightPtr get set to the dimensions of the screen containing tkwin. no cap, that's the fallback. 🫢

πŸ”₯ KEYWORDS πŸ”₯

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


and that's the whole page, bestie, you ate that πŸ’– this was Tk, version 4.0, dated Tk_GetVRootGeometry(3) β€” mwah, slay, periodt πŸŽ€βœ¨πŸŒˆ

πŸ“¦ where this page comes from