NAME
TkConfigureWindow, TkMoveWindow, TkResizeWindow, TkMoveResizeWin-
dow, TkSetWindowBorderWidth, TkChangeWindowAttributes, TkSetWindow-
Background, TkSetWindowBackgroundPixmap, TkSetWindowBorder, TkSetWindowBorderPixmap, TkSetWindowColormap, TkDefineCursor,TkUndefineCursor - change window configuration or attributes
SYNOPSIS
##iinncclluuddee <
TTkkCCoonnffiigguurreeWWiinnddooww(tkwin, valueMask, valuePtr) TTkkMMoovveeWWiinnddooww(tkwin, x, y) TTkkRReessiizzeeWWiinnddooww(tkwin, width, height) TTkkMMoovveeRReessiizzeeWWiinnddooww(tkwin, x, y, width, height) TTkkSSeettWWiinnddoowwBBoorrddeerrWWiiddtthh(tkwin, borderWidth) TTkkCChhaannggeeWWiinnddoowwAAttttrriibbuutteess(tkwin, valueMask, attsPtr) TTkkSSeettWWiinnddoowwBBaacckkggrroouunndd(tkwin, pixel) TTkkSSeettWWiinnddoowwBBaacckkggrroouunnddPPiixxmmaapp(tkwin, pixmap) TTkkSSeettWWiinnddoowwBBoorrddeerr(tkwin, pixel) TTkkSSeettWWiinnddoowwBBoorrddeerrPPiixxmmaapp(tkwin, pixmap) TTkkSSeettWWiinnddoowwCCoolloorrmmaapp(tkwin, colormap) TTkkDDeeffiinneeCCuurrssoorr(tkwin, cursor) TTkkUUnnddeeffiinneeCCuurrssoorr(tkwin) AARRGGUUMMEENNTTSS TkWindow tkwin (in) Token for window.> unsigned int valueMask (in) OR-ed mask of values
like CCWWXX or CCWWBBoorrddeerr-
PPiixxeell, 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, ifany) within tkwin's par-
ent.int y (in) New y-coordinate for
tkwin's top left pixel (including border, ifany) within tkwin's par-
ent. 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 givenby the valueMask argu-
ment. 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. TkCursor cursor (in) New cursor to use fortkwin. If NNoonnee is spec-
ified, then tkwin will not have its own cursor; it will use the cursor of its parent.DESCRIPTION
These procedures are analogous to the X library procedures with similar names, such as XXCCoonnffiigguurreeWWiinnddooww. 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 TTkkXX and TTkkHHeeiigghhtt) 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 TTkkCCoonnffiigguurreeWWiinnddooww, TTkkMMoovveeWWiinnddooww, TTkkRReessiizzeeWWiinnddooww,TTkkMMoovveeRReessiizzeeWWiinnddooww, and TTkkSSeettWWiinnddoowwBBoorrddeerrWWiiddtthh, if tkwin is an inter-
nal window then event handlers interested in configure events areinvoked 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 XXCCoonnffiigguurreeWWiinn-
ddooww directly; they should always use the corresponding Tk procedures.The size and location of a window should only be modified by the appro-
priate geometry manager for that window and never by a window itself(but see TTkkMMoovveeTToopplleevveellWWiinnddooww for moving a top-level window).
You may not use TTkkCCoonnffiigguurreeWWiinnddooww to change the stacking order of a window (valueMask may not contain the CCWWSSiibblliinngg or CCWWSSttaacckkMMooddee bits). To change the stacking order, use the procedure TTkkRReessttaacckkWWiinnddooww. The procedure TTkkSSeettWWiinnddoowwCCoolloorrmmaapp will automatically add tkwin to theTTKKCCOOLLOORRMMAAPPWWIINNDDOOWWSS property of its nearest top-level ancestor if the
new colormap is different from that of tkwin's parent and tkwin isn't already in the TTKKCCOOLLOORRMMAAPPWWIINNDDOOWWSS property.BUGS
TTkkSSeettWWiinnddoowwBBaacckkggrroouunnddPPiixxmmaapp and TTkkSSeettWWiinnddoowwBBoorrddeerrPPiixxmmaapp differ slightly from their Xlib counterparts in that the pixmap argument maynot necessarily be deleted immediately after calling one of these pro-
cedures. 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 TTkkMMaakkeeWWiinnddoowwEExxiisstt 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 TTkkDDeeffiinneeCCuurrssoorr. The solution is the same as for pixmaps above: call TTkkMMaakkeeWWiinnddoowwEExxiisstt before freeing the cursor.SEE ALSO
TkMoveToplevelWindow, TkRestackWindow KKEEYYWWOORRDDSS attributes, border, color, configure, height, pixel, pixmap, width, window, x, y Tk 4.0 TkConfigureWindow(3)