Tk_GeometryRequest(3)
π Tk_GeometryRequest β Tk Library Procedures, bestie edition β¨
okay so welcome to the Tk Library Procedures corner of the manual-verse, where we talk about asking for window geometry like the confident Unix girlies we are. π
β¨ NAME β¨
Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx β specify desired geometry or internal border for a window. That's the whole squad, no cap. π«Ά
π SYNOPSIS π
#include <tk.h>
Tk_GeometryRequest(tkwin, reqWidth, reqHeight)
Tk_SetMinimumRequestSize(tkwin, minWidth, minHeight)
Tk_SetInternalBorder(tkwin, width)
Tk_SetInternalBorderEx(tkwin, left, right, top, bottom)
π§Ύ ARGUMENTS π§Ύ
Tk_Window tkwin(in) β the window whose geometry is being requested, aka the main character of this call.int reqWidth(in) β desired width fortkwin, in pixel units.int reqHeight(in) β desired height fortkwin, in pixel units.int minWidth(in) β desired minimum requested width fortkwin, in pixel units.int minHeight(in) β desired minimum requested height fortkwin, in pixel units.int width(in) β space to leave for the internal border fortkwin, in pixel units.int left(in) β space to leave for the left side of the internal border fortkwin, in pixel units.int right(in) β space to leave for the right side of the internal border fortkwin, in pixel units.int top(in) β space to leave for the top side of the internal border fortkwin, in pixel units.int bottom(in) β space to leave for the bottom side of the internal border fortkwin, in pixel units.
π¦ DESCRIPTION π¦
Tk_GeometryRequest is called by widget code to indicate its preference for the dimensions of a particular window. The arguments to Tk_GeometryRequest are made available to the geometry manager for the window, which then decides on the actual geometry for the window.
Geometry managers generally try to satisfy requests made to Tk_GeometryRequest, but there is no guarantee that this will always be possible. Widget code should not assume that a geometry request will be satisfied until it receives a ConfigureNotify event indicating that the geometry change has occurred. Widget code should never call procedures like Tk_ResizeWindow directly. Instead, it should invoke Tk_GeometryRequest and leave the final geometry decisions to the geometry manager.
this is the βtrust the processβ of Tk geometry, bestie: request, wait forConfigureNotify, and do not grab the steering wheel by callingTk_ResizeWindowyourself π
If tkwin is a top-level window, then the geometry information will be passed to the window manager using the standard ICCCM protocol.
Tk_SetInternalBorder is called by widget code to indicate that the widget has an internal border. This means that the widget draws a decorative border inside the window instead of using the standard X borders, which are external to the window's area. For example, internal borders are used to draw 3-D effects. width specifies the width of the border in pixels. Geometry managers will use this information to avoid placing any children of tkwin overlapping the outermost width pixels of tkwin's area.
Tk_SetInternalBorderEx works like Tk_SetInternalBorder but lets you specify different widths for different sides of the window. π
Tk_SetMinimumRequestSize is called by widget code to indicate that a geometry manager should request at least this size for the widget. This allows a widget to have some control over its size when a propagating geometry manager is used inside it.
The information specified in calls to Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder and Tk_SetInternalBorderEx can be retrieved using the macros Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_MinReqWidth, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop and Tk_InternalBorderBottom. See the Tk_WindowId manual entry for details.
not me noticing Tk_MinReqWidth shows up twice in that macro list β but that's literally what's written, so it stays, periodt. π
π KEYWORDS π
geometry, request
that's the whole page, bestie. the footer vibe on this one is Tk 8.4 and there's no separate date printed, so that's the version-and-date situation we're leaving you with β slay, go request some geometry responsibly ππ¦
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- 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-1017 on : a language model's rewrite of the original, under its terms