Tk_WindowId — C Library Procedures
NAME
Tk_WindowId, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsMapped, Tk_ReqWidth, Tk_ReqHeight, Tk_InternalBorderWidth − retrieve information from Tk’s local data structure
SYNOPSIS
#include <tk.h>
Window
Tk_WindowId(tkwin)
Tk_Window
Tk_Parent(tkwin)
Display ∗
Tk_Display(tkwin)
char ∗
Tk_DisplayName(tkwin)
int
Tk_ScreenNumber(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_IsMapped(tkwin)
int
Tk_ReqWidth(tkwin)
int
Tk_ReqHeight(tkwin)
int
Tk_InternalBorderWidth(tkwin)
ARGUMENTS
Tk_Windowtkwin(in) Token for window.
DESCRIPTION
Tk_WindowID and the other names listed above are all macros that return fields from Tk’s local data structure for tkwin. None of these macros requires any interaction with the server; it is safe to assume that all are fast.
Tk_WindowId returns the X identifier for tkwin, or NULL if no X window has been created for tkwin yet (see the Tk_CreateMainWindow manual entry for details).
Tk_Parent returns Tk’s token for the logical parent of tkwin. The parent is the token that was specified when tkwin was created, or NULL for main windows.
Tk_Display returns a pointer to the Xlib display structure corresponding to tkwin. Tk_DisplayName returns an ASCII string identifying tkwin’s display. Tk_ScreenNumber returns the index of tkwin’s screen among all the screens of tkwin’s display. Tk_Screen returns a pointer to the Xlib structure corresponding to tkwin’s screen.
Tk_X, Tk_Y, Tk_Width, and Tk_Height return information about tkwin’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 an XSetWindowAttributes structure describing all of the attributes of the tkwin’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). Note: it is essential that applications use Tk procedures like Tk_ResizeWindow instead of X procedures like XResizeWindow, so that Tk can keep its data structures up-to-date.
Tk_IsMapped returns a non-zero value if tkwin is mapped and zero if tkwin isn’t mapped.
Tk_ReqWidth and Tk_ReqHeight return information about the window’s requested size. These values correspond to the last call to Tk_GeometryRequest for tkwin.
Tk_InternalBorderWidth returns the width of internal border that has been requested for tkwin, or 0 if no internal border was requested. The return value is simply the last value passed to Tk_SetInternalBorder for tkwin.
KEYWORDS
attributes, display, height, geometry manager, identifier, mapped, requested size, screen, width, window, x, y
Sprite version 1.0 —