Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetWindowBorderWidth, Tk_ChangeWindowAttributes, Tk_SetWindowBackground, Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder, Tk_SetWindowBorderPixmap, Tk_SetWindowColormap, Tk_DefineCursor, Tk_UndefineCursor − change window configuration or attributes


#include <tk.h>

Tk_ConfigureWindow(tkwin, valueMask, valuePtr)

Tk_MoveWindow(tkwin, x, y)

Tk_ResizeWindow(tkwin, width, height)

Tk_MoveResizeWindow(tkwin, x, y, width, height)

Tk_SetWindowBorderWidth(tkwin, borderWidth)

Tk_ChangeWindowAttributes(tkwin, valueMask, attsPtr)

Tk_SetWindowBackground(tkwin, pixel)

Tk_SetWindowBackgroundPixmap(tkwin, pixmap)

Tk_SetWindowBorder(tkwin, pixel)

Tk_SetWindowBorderPixmap(tkwin, pixmap)

Tk_SetWindowColormap(tkwin, colormap)

Tk_DefineCursor(tkwin, cursor)



Tk_Window tkwin (in)

Token for window.

unsigned int valueMask (in)

OR-ed mask of values like CWX or CWBorderPixel, indicating which fields of *valuePtr or *attsPtr to use.

XWindowChanges *valuePtr (in)

Points to a structure containing new values for the configuration parameters selected by valueMask. Fields not selected by valueMask are ignored.

int x (in)

New x-coordinate for tkwin’s top left pixel (including border, if any) within tkwin’s parent.

int y (in)

New y-coordinate for tkwin’s top left pixel (including border, if any) within tkwin’s parent.

int width (in)

New width for tkwin (interior, not including border).

int height (in)

New height for tkwin (interior, not including border).

int borderWidth (in)

New width for tkwin’s border.

XSetWindowAttributes *attsPtr (in)

Points to a structure containing new values for the attributes given by the valueMask argument. Attributes not selected by valueMask are ignored.

unsigned long pixel (in)

New background or border color for window.

Pixmap pixmap (in)

New pixmap to use for background or border of tkwin. WARNING: cannot necessarily be deleted immediately, as for Xlib calls. See note below.

Colormap colormap (in)

New colormap to use for tkwin.

Tk_Cursor cursor (in)

New cursor to use for tkwin. If None is specified, then tkwin will not have its own cursor; it will use the cursor of its parent.



These procedures are analogous to the X library procedures with similar names, such as XConfigureWindow. Each one of the above procedures calls the corresponding X procedure and also saves the configuration information in Tk’s local structure for the window. This allows the information to be retrieved quickly by the application (using macros such as Tk_X and Tk_Height) without having to contact the X server. In addition, if no X window has actually been created for tkwin yet, these procedures do not issue X operations or cause event handlers to be invoked; they save the information in Tk’s local structure for the window; when the window is created later, the saved information will be used to configure the window.

See the X library documentation for details on what these procedures do and how they use their arguments.

In the procedures Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, and Tk_SetWindowBorderWidth, if tkwin is an internal window then event handlers interested in configure events are invoked immediately, before the procedure returns. If tkwin is a top-level window then the event handlers will be invoked later, after X has seen the request and returned an event for it.

Applications using Tk should never call procedures like XConfigureWindow directly; they should always use the corresponding Tk procedures.

The size and location of a window should only be modified by the appropriate geometry manager for that window and never by a window itself (but see Tk_MoveToplevelWindow for moving a top-level window).

You may not use Tk_ConfigureWindow to change the stacking order of a window (valueMask may not contain the CWSibling or CWStackMode bits). To change the stacking order, use the procedure Tk_RestackWindow.

The procedure Tk_SetWindowColormap will automatically add tkwin to the TK_COLORMAP_WINDOWS property of its nearest top-level ancestor if the new colormap is different from that of tkwin’s parent and tkwin is not already in the TK_COLORMAP_WINDOWS property.


Tk_SetWindowBackgroundPixmap and Tk_SetWindowBorderPixmap differ slightly from their Xlib counterparts in that the pixmap argument may not necessarily be deleted immediately after calling one of these procedures. This is because tkwin’s window may not exist yet at the time of the call, in which case pixmap is merely saved and used later when tkwin’s window is actually created. If you wish to delete pixmap, then call Tk_MakeWindowExist first to be sure that tkwin’s window exists and pixmap has been passed to the X server.

A similar problem occurs for the cursor argument passed to Tk_DefineCursor. The solution is the same as for pixmaps above: call Tk_MakeWindowExist before freeing the cursor.


Tk_MoveToplevelWindow, Tk_RestackWindow


attributes, border, color, configure, height, pixel, pixmap, width, window, x, y

More Linux Commands

join(n) - Create a string by joining together list elements
The list argument must be a valid Tcl list. This command returns the string formed by joining all of the elements of list together with joinString separating ea

Tcl_CreateInterp(3) - create and delete Tcl command interpre
Tcl_CreateInterp creates a new interpreter structure and returns a token for it. The token is required in calls to most other Tcl procedures, such as Tcl_Create

tcdrain(3) - get and set terminal attributes, line control,
The termios functions describe a general terminal interface that is provided to control asynchronous communications ports. The termios structure Many of the fun

XkbGetAutoResetControls(3) - Gets the current values of the
You can configure the boolean controls to automatically be enabled or disabled when a program exits. This capability is controlled via two masks maintained in t

MIME::Body(3pm) - the body of a MIME message (Man Page).....
MIME messages can be very long (e.g., tar files, MPEGs, etc.) or very short (short textual notes, as in ordinary mail). Long messages are best stored in files,

git-remote-helpers(1) - Helper programs to interact with rem
Remote helper programs are normally not used directly by end users, but they are invoked by git when it needs to interact with remote repositories git does not

roff2ps(1) - transform roff code into ps mode (Man Page)....
roff2ps transforms roff code into ps mode. Print the result to standard output. There are more of these programs for generating other formats of roff input. rof

smbcquotas(1) - Set or get QUOTAs of NTFS 5 shares (ManPage)
This tool is part of the samba(7) suite. The smbcquotas program manipulates NT Quotas on SMB file shares. OPTIONS The following options are available to the smb

mvwinnwstr(3ncurses) - get a string of wchar_t characters fr
These routines return a string of wchar_t characters in wstr, extracted starting at the current cursor position in the named window. Attributes are stripped fro

machinectl(1) Control the systemd machine manager (ManPage)
machinectl may be used to introspect and control the state of the systemd(1) virtual machine and container registration manager systemd-machined.service(8). OPT

write(2) - write to a file descriptor - Linux manual page...
write() writes up to count bytes from the buffer pointed buf to the file referred to by the file descriptor fd. The number of bytes written may be less than cou

Tk_CreateImageType(3) - define new kind of image (Man Page)
Tk_CreateImageType is invoked to define a new kind of image. An image type corresponds to a particular value of the type argument for the image create command.

We can't live, work or learn in freedom unless the software we use is free.