Tk_WindowId(3)
π
Tk_WindowId(3) β Tk Library Procedures, but make it make sense π
okay bestie, this is the Tk_WindowId(3) page from the Tk Library Procedures manual, and it's literally a whole squad of macros that let you retrieve information from Tk's local data structure. No server gossip required β none of these macros needs any interaction with the server, and it is safe to assume that all are fast. β¨
π NAME π
Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_AlwaysShowSelection, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp, Tk_NewWindowObj β retrieve information from Tk's local data structure. periodt π
β¨ SYNOPSIS β¨
#include <tk.h>
Window
Tk_WindowId(tkwin)
Tk_Window
Tk_Parent(tkwin)
Display *
Tk_Display(tkwin)
const char *
Tk_DisplayName(tkwin)
int
Tk_ScreenNumber(tkwin)
int
Tk_AlwaysShowSelection(tkwin)
Screen *
Tk_Screen(tkwin)
int
Tk_X(tkwin)
int
Tk_Y(tkwin)
int
Tk_Width(tkwin)
int
Tk_Height(tkwin)
XWindowChanges *
Tk_Changes(tkwin)
XSetWindowAttributes *
Tk_Attributes(tkwin)
int
Tk_IsContainer(tkwin)
int
Tk_IsEmbedded(tkwin)
int
Tk_IsMapped(tkwin)
int
Tk_IsTopLevel(tkwin)
int
Tk_ReqWidth(tkwin)
int
Tk_ReqHeight(tkwin)
int
Tk_MinReqWidth(tkwin)
int
Tk_MinReqHeight(tkwin)
int
Tk_InternalBorderLeft(tkwin)
int
Tk_InternalBorderRight(tkwin)
int
Tk_InternalBorderTop(tkwin)
int
Tk_InternalBorderBottom(tkwin)
Visual *
Tk_Visual(tkwin)
int
Tk_Depth(tkwin)
Colormap
Tk_Colormap(tkwin)
Tcl_Interp *
Tk_Interp(tkwin)
Tcl_Obj *
Tk_NewWindowObj(tkwin)
π¦ ARGUMENTS π¦
Tk_Window tkwin(in) β token for window, bestie. That's the whole vibe.
πΈ DESCRIPTION πΈ
Tk_WindowId and all the other names listed above are macros that return fields from Tk's local data structure for tkwin. None of them needs any interaction with the server β yes, it is safe to assume they are fast. π
Tk_WindowIdβ returns the X identifier fortkwin, orNULLif no X window has been created fortkwinyet.Tk_Parentβ returns Tk's token for the logical parent oftkwin. The parent is the token that was specified whentkwinwas created, orNULLfor main windows.Tk_Interpβ returns the Tcl interpreter associated with atkwin, orNULLif there is an error.Tk_Displayβ returns a pointer to the Xlib display structure corresponding totkwin.Tk_DisplayNameβ returns an ASCII string identifyingtkwin's display.Tk_ScreenNumberβ returns the index oftkwin's screen among all the screens oftkwin's display.Tk_Screenβ returns a pointer to the Xlib structure corresponding totkwin's screen.Tk_AlwaysShowSelectionβ indicates whether text/entry widgets should always display their selection, regardless of window focus.Tk_X,Tk_Y,Tk_Width,Tk_Heightβ return information abouttkwin's location within its parent and its size. The location information refers to the upper-left pixel in the window, or its border if there is one. The width and height information refers to the interior size of the window, not including any border.Tk_Changesβ returns a pointer to a structure containing all of the above information plus a few other fields.Tk_Attributesβ returns a pointer to anXSetWindowAttributesstructure describing all of the attributes of thetkwin's window, such as background pixmap, event mask, and so on. Tk keeps track of all this information as it is changed by the application. π
no cap: it is essential that applications use Tk procedures likeTk_ResizeWindowinstead of X procedures likeXResizeWindow, so that Tk can keep its data structures up-to-date. do not skip this, bestie π
Tk_IsContainerβ returns a non-zero value iftkwinis a container, and that some other application may be embedding itself insidetkwin.Tk_IsEmbeddedβ returns a non-zero value iftkwinis not a free-standing window, but rather is embedded in some other application.Tk_IsMappedβ returns a non-zero value iftkwinis mapped and zero iftkwinis not mapped.Tk_IsTopLevelβ returns a non-zero value iftkwinis a top-level window (its X parent is the root window of the screen) and zero iftkwinis not a top-level window.Tk_ReqWidthandTk_ReqHeightβ return information about the window's requested size. These values correspond to the last call toTk_GeometryRequestfortkwin.Tk_MinReqWidthandTk_MinReqHeightβ return information about the window's minimum requested size. These values correspond to the last call toTk_SetMinimumRequestSizefortkwin.Tk_InternalBorderLeft,Tk_InternalBorderRight,Tk_InternalBorderTop, andTk_InternalBorderBottomβ return the width of one side of the internal border that has been requested fortkwin, or0if no internal border was requested. The return value is simply the last value passed toTk_SetInternalBorderorTk_SetInternalBorderExfortkwin.Tk_Visual,Tk_Depth, andTk_Colormapβ return information about the visual characteristics of a window.Tk_Visualreturns the visual type for the window,Tk_Depthreturns the number of bits per pixel, andTk_Colormapreturns the current colormap for the window. The visual characteristics are normally set from the defaults for the window's screen, but they may be overridden by callingTk_SetWindowVisual.Tk_NewWindowObjβ creates a newTcl_Objfrom the window.
π KEYWORDS π
attributes, colormap, depth, display, height, geometry manager, identifier, mapped, requested size, screen, top-level, visual, width, window, x, y
okay that's the whole page, bestie π«Ά this cute little sign-off comes from Tk 8.4 and the page is Tk_WindowId(3) β the footer didn't give a date, so there's no date to report, and that's on periodt πβ¨π
π¦ 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-1993 The Regents of the University of California
- Copyright (c) 1994-1997 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms