Tk_GetRootCoords(3tk)
β¨ Tk_GetRootCoords β¨
okay bestie, so this one is from the Tk Library Procedures corner of the world β page name's Tk_GetRootCoords(3tk), and it's genuinely such a useful little function, iykyk π
πΈ NAME πΈ
Tk_GetRootCoords β compute root-window coordinates of a window π¦
π SYNOPSIS π
#include <tk.h>
Tk_GetRootCoords(tkwin, xPtr, yPtr)
π ARGUMENTS π
Tk_Window tkwin(in) β the token for the window, like its lil ID badge πͺͺint *xPtr(out) β pointer to the spot where you want the root-window x-coordinate stored, the one matching the left edge oftkwin's border πint *yPtr(out) β pointer to the spot where you want the root-window y-coordinate stored, the one matching the top edge oftkwin's border π
π DESCRIPTION π
So what this procedure does is scan through all the structural info that Tk is already keeping around and use it to compute the root-window coordinates that line up with the upper-left corner of tkwin's border. no cap, that's the whole vibe π«
And if tkwin has no border at all? Then Tk_GetRootCoords just hands you back the root-window coordinates corresponding to location (0,0) in tkwin. simple as that, periodt β¨
The other thing that's lowkey iconic about it: Tk_GetRootCoords is relatively efficient, because it does not have to communicate with the X server πββοΈπ¨ like, it just already knows. main character energy fr fr π
π KEYWORDS π
coordinates, root window
and that's the whole page, bestie β straight from the Tk source, page Tk_GetRootCoords(3tk). go get those coordinates, you absolute icon π«Άβ¨π
π¦ 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