Tk_GetRootCoords(3)

πŸŽ€ NAME πŸŽ€

okay so welcome to Tk_GetRootCoords(3) from the Tk Library Procedures manual β€” she's here to Compute root-window coordinates of window, and yes bestie, she ate πŸ’…

Tk_GetRootCoords - Compute root-window coordinates of window


✨ SYNOPSIS ✨

#include <tk.h>

Tk_GetRootCoords(tkwin, xPtr, yPtr)

🌸 ARGUMENTS 🌸

  • Tk_Window tkwin (in) β€” Token for window. it's literally the little handle that tells you which window we're talking about 🫢
  • int *xPtr (out) β€” Pointer to location in which to store root-window x-coordinate corresponding to left edge of tkwin's border ✨
  • int *yPtr (out) β€” Pointer to location in which to store root-window y-coordinate corresponding to top edge of tkwin's border πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

This procedure scans through the structural information maintained by Tk to compute the root-window coordinates corresponding to the upper-left corner of tkwin's border. like, it's doing the coordinate math through Tk's own structural tea, no cap πŸ”₯

If tkwin has no border, then Tk_GetRootCoords returns the root-window coordinates corresponding to location (0,0) in tkwin. okay so no border? we're still locked in at (0,0) πŸ’–

Tk_GetRootCoords is relatively efficient, since it does not have to communicate with the X server. highkey iconic behavior β€” fast because it doesn't need to chat with the X server, periodt 🌈


πŸ‘‘ KEYWORDS πŸ‘‘

coordinates, root window β€” iykyk 🧚


xoxo, signing off from the Tk source/version zone with page Tk_GetRootCoords(3) πŸ’œβœ¨

πŸ“¦ where this page comes from