Tk_SetGrid(3)

πŸ’… NAME πŸ’…

Okay bestie, welcome to Tk_SetGrid(3) from the Tk Library Procedures corner of the universe ✨ This page is all about Tk_SetGrid and Tk_UnsetGrid β€” the duo that controls the grid for interactive resizing. Periodt. 🫢


✨ SYNOPSIS ✨

#include <tk.h>

Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)

Tk_UnsetGrid(tkwin)

πŸŽ€ ARGUMENTS πŸŽ€

  • Tk_Window tkwin (in) β€” Token for window. The little handle for the window in question, iykyk πŸ’…
  • int reqWidth (in) β€” Width in grid units that corresponds to the pixel dimension tkwin has requested via Tk_GeometryRequest.
  • int reqHeight (in) β€” Height in grid units that corresponds to the pixel dimension tkwin has requested via Tk_GeometryRequest.
  • int widthInc (in) β€” Width of one grid unit, in pixels.
  • int heightInc (in) β€” Height of one grid unit, in pixels.

πŸ¦‹ DESCRIPTION πŸ¦‹

So Tk_SetGrid turns on gridded geometry management for tkwin's toplevel window and specifies the geometry of the grid. It is typically invoked by a widget when its setGrid option is true. No cap. πŸ’–

It restricts interactive resizing of tkwin's toplevel window so that the space allocated to the toplevel is equal to its requested size plus or minus even multiples of widthInc and heightInc. Furthermore, the reqWidth and reqHeight values are passed to the window manager so that it can report the window's size in grid units during interactive resizes. If tkwin's configuration changes (e.g., the size of a grid unit changes) then the widget should invoke Tk_SetGrid again with the new information. Slay, keep it updated πŸ’…

Tk_UnsetGrid cancels gridded geometry management for tkwin's toplevel window. Bye-bye grid mode, bestie πŸ‘‹

For each toplevel window there can be at most one internal window with gridding enabled. Highkey important. If Tk_SetGrid or Tk_UnsetGrid is invoked when some other window is already controlling gridding for tkwin's toplevel, the calls for the new window have no effect.

🌸 Heads-up, bestie: if another window already has gridding control for that toplevel, the new window’s Tk_SetGrid / Tk_UnsetGrid calls literally do nothing. It’s giving β€œnot my main character moment” πŸ’€

See the wm manual entry for additional information on gridded geometry management. Go read it, iykyk πŸ“–βœ¨


πŸ”₯ KEYWORDS πŸ”₯

grid, window, window manager πŸ‘‘


πŸ’– Signed off from the Tk Library Procedures corner: Tk 4.0, Tk_SetGrid(3) β€” no date listed on this page, bestie, so that’s the whole footer tea πŸ«–βœ¨

πŸ“¦ where this page comes from