Tk_GetVRootGeometry(3tk)
β¨ 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 β iftkwinis not associated with a virtual root (like, say, because your window manager simply does not do virtual roots), then*xPtrand*yPtrget set to0, and*widthPtrand*heightPtrget set to the dimensions of the screen containingtkwin. 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
- debian trixie: tk9.0-doc 9.0.1-3
- ubuntu questing: tk9.0-doc 9.0.2-1
- ubuntu resolute: tk9.0-doc 9.0.3-1
- ubuntu stonking: tk9.0-doc 9.0.4-1
- Copyright (c) 1990 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms