Tk_ManageGeometry(3tk)
β¨ Tk_ManageGeometry β¨
okay bestie so this is the Tk Library Procedures page for Tk_ManageGeometry π and it's literally the function that lets you hand a window over to a geometry manager so somebody else handles all the "where do i go, how big am i" drama. sit down, grab a boba, we're doing this π§
πΈ NAME πΈ
Tk_ManageGeometry β arrange to handle geometry requests for a window π
β¨ SYNOPSIS β¨
#include <tk.h>
Tk_ManageGeometry(tkwin, mgrPtr, clientData)
π ARGUMENTS π
Tk_Window tkwin(in) β the token for the window you wanna manage, bestie πͺconst Tk_GeomMgr *mgrPtr(in) β pointer to a data structure holding the tea about the geometry manager, orNULLif you're saying "okay no more managing this window's geometry, we're done π". Important: the structuremgrPtrpoints to must be static β Tk keeps a reference to it for as long as the window stays managed. no stack shenanigans, i'm so serious πvoid *clientData(in) β some arbitrary one-word value that gets passed along to the geometry manager callbacks. put whatever you want in there, it's your little secret π
π DESCRIPTION π
Tk_ManageGeometry arranges for one specific geometry manager β described by mgrPtr β to control the geometry of a specific content window, tkwin. the way that it justβ¦ hands over the keys π
if tkwin was already being managed by some other geometry manager, the old one loses control in favor of the new one. sorry not sorry, it's giving replacement era π
. and if mgrPtr is NULL, geometry management for tkwin is cancelled. no manager, no problem.
the structure that mgrPtr points to is holding all the info about the geometry manager:
typedef struct {
const char *name;
Tk_GeomRequestProc *requestProc;
Tk_GeomLostContentProc *lostContentProc;
} Tk_GeomMgr;
the name field is the textual name of the geometry manager, like pack or place. this is the value that the command winfo manager will hand back to you. it's literally the manager's whole identity, iconic β¨
requestProc is a procedure inside the geometry manager that gets invoked whenever Tk_GeometryRequest is called by the content window to change its desired geometry. basically: the window goes "hey i want to be this big now" and requestProc gets the notification π. requestProc needs arguments and results matching the type Tk_GeomRequestProc:
typedef void Tk_GeomRequestProc(
void *clientData,
Tk_Window tkwin);
the parameters handed to requestProc will be identical to the corresponding parameters passed to Tk_ManageGeometry. and clientData usually points to a data structure holding application-specific info about how to manage tkwin's geometry. so like, your little info bag, but for geometry π
the lostContentProc field of mgrPtr points to another procedure in the geometry manager. Tk will invoke lostContentProc if some other manager calls Tk_ManageGeometry and claims tkwin away from the current geometry manager. it's the "they took my window π" callback.
but wait βlostContentProcis not invoked ifTk_ManageGeometryis called with aNULLvalue formgrPtr(presumably the current geometry manager made that call itself, so it already knows the window isn't managed anymore). it's also not called ifmgrPtris the same as the window's current geometry manager. no duplicate notifications in this house π«
lostContentProc should have arguments and results matching this prototype:
typedef void Tk_GeomLostContentProc(
void *clientData,
Tk_Window tkwin);
the parameters to lostContentProc will be identical to the corresponding parameters passed to Tk_ManageGeometry. consistency is the vibe π¦
π KEYWORDS π
callback, geometry, managed, request, unmanaged
that's the whole page bestie, go forth and manage some geometry, you got this fr fr π«Άπβ
and a lil sign-off: this page is from Tk, version 4.0, and it's the Tk_ManageGeometry(3tk) manual page β stay managed, stay iconic ππ
π¦ 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-1994 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