Tk_CoordsToWindow(3tk)

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

okay bestie, welcome to Tk_CoordsToWindow(3tk) β€” fresh from the Tk Library Procedures. This is your glow-up guide to finding which window is under a point, and she is serving exact coordinates with zero nonsense. πŸ’…βœ¨


🌸 NAME 🌸

Tk_CoordsToWindow β€” find the window containing a point. That is the whole assignment, and she ate. 🫢


✨ SYNOPSIS ✨

#include <tk.h>

Tk_Window
Tk_CoordsToWindow(rootX, rootY, tkwin)

πŸŽ€ ARGUMENTS πŸŽ€

  • int rootX (in) β€” the X-coordinate, in root window coordinates. Yes, root window coords, not vibes. πŸ’–
  • int rootY (in) β€” the Y-coordinate, in root window coordinates. Same energy. ✨
  • Tk_Window tkwin (in) β€” a token for the window that identifies the application. Think of it as the app’s little name tag. 🏷️

πŸ’– DESCRIPTION πŸ’–

Okay so Tk_CoordsToWindow locates the window that contains a given point. The point is specified in root coordinates with rootX and rootY. If a virtual-root window manager is in use, then rootX and rootY are in the coordinate system of the virtual root window. Virtual root? Still root coords, just the virtual one. iykyk. 🧚

The return value from the procedure is a token for the window that contains the given point. If the point is not in any window, or if the containing window is not in the same application as tkwin, then NULL is returned. Not a window token, not a maybe, just NULL. πŸ’€

The containing window is decided using the same rules that determine which window contains the mouse cursor: if a parent and a child both contain the point, then the child gets preference. And if two siblings both contain the point, then the highest one in the stacking order β€” i.e. the one that’s visible on the screen β€” gets preference. Stacking order is the moment, and the visible sibling wins. Periodt. πŸ‘‘


🌈 KEYWORDS 🌈

  • containing
  • coordinates
  • root window

Source/version: Tk. Page: Tk_CoordsToWindow(3tk). Date: the footer didn’t list one, so no invented date, bestie β€” just pure Tk manual energy. Mwah πŸ’‹πŸ¦‹

πŸ“¦ where this page comes from