1Tk_ConfigureWindow(3)        Tk Library Procedures       Tk_ConfigureWindow(3)
2
3
4
5______________________________________________________________________________
6

NAME

8       Tk_ConfigureWindow,  Tk_MoveWindow,  Tk_ResizeWindow, Tk_MoveResizeWin‐
9       dow, Tk_SetWindowBorderWidth, Tk_ChangeWindowAttributes,  Tk_SetWindow‐
10       Background,      Tk_SetWindowBackgroundPixmap,      Tk_SetWindowBorder,
11       Tk_SetWindowBorderPixmap,    Tk_SetWindowColormap,     Tk_DefineCursor,
12       Tk_UndefineCursor - change window configuration or attributes
13

SYNOPSIS

15       #include <tk.h>
16
17       Tk_ConfigureWindow(tkwin, valueMask, valuePtr)
18
19       Tk_MoveWindow(tkwin, x, y)
20
21       Tk_ResizeWindow(tkwin, width, height)
22
23       Tk_MoveResizeWindow(tkwin, x,  y, width, height)
24
25       Tk_SetWindowBorderWidth(tkwin, borderWidth)
26
27       Tk_ChangeWindowAttributes(tkwin, valueMask, attsPtr)
28
29       Tk_SetWindowBackground(tkwin, pixel)
30
31       Tk_SetWindowBackgroundPixmap(tkwin, pixmap)
32
33       Tk_SetWindowBorder(tkwin, pixel)
34
35       Tk_SetWindowBorderPixmap(tkwin, pixmap)
36
37       Tk_SetWindowColormap(tkwin, colormap)
38
39       Tk_DefineCursor(tkwin, cursor)
40
41       Tk_UndefineCursor(tkwin)
42

ARGUMENTS

44       Tk_Window tkwin (in)                           Token for window.
45
46       unsigned int valueMask (in)                    OR-ed   mask  of  values
47                                                      like  CWX  or  CWBorder‐
48                                                      Pixel,  indicating which
49                                                      fields of  *valuePtr  or
50                                                      *attsPtr to use.
51
52       XWindowChanges *valuePtr (in)                  Points  to  a  structure
53                                                      containing  new   values
54                                                      for   the  configuration
55                                                      parameters  selected  by
56                                                      valueMask.   Fields  not
57                                                      selected  by   valueMask
58                                                      are ignored.
59
60       int x (in)                                     New   x-coordinate   for
61                                                      tkwin's top  left  pixel
62                                                      (including   border,  if
63                                                      any) within tkwin's par‐
64                                                      ent.
65
66       int y (in)                                     New   y-coordinate   for
67                                                      tkwin's top  left  pixel
68                                                      (including   border,  if
69                                                      any) within tkwin's par‐
70                                                      ent.
71
72       int width (in)                                 New   width   for  tkwin
73                                                      (interior, not including
74                                                      border).
75
76       int height (in)                                New   height  for  tkwin
77                                                      (interior, not including
78                                                      border).
79
80       int borderWidth (in)                           New  width  for  tkwin's
81                                                      border.
82
83       XSetWindowAttributes *attsPtr (in)             Points  to  a  structure
84                                                      containing   new  values
85                                                      for the attributes given
86                                                      by  the  valueMask argu‐
87                                                      ment.   Attributes   not
88                                                      selected   by  valueMask
89                                                      are ignored.
90
91       unsigned long pixel (in)                       New background or border
92                                                      color for window.
93
94       Pixmap pixmap (in)                             New  pixmap  to  use for
95                                                      background or border  of
96                                                      tkwin.   WARNING: cannot
97                                                      necessarily  be  deleted
98                                                      immediately, as for Xlib
99                                                      calls.  See note below.
100
101       Colormap colormap (in)                         New colormap to use  for
102                                                      tkwin.
103
104       Tk_Cursor cursor (in)                          New  cursor  to  use for
105                                                      tkwin.  If None is spec‐
106                                                      ified,  then  tkwin will
107                                                      not have its own cursor;
108                                                      it  will  use the cursor
109                                                      of its parent.
110_________________________________________________________________
111

DESCRIPTION

113       These procedures are analogous to the X library procedures with similar
114       names,  such  as  XConfigureWindow.   Each  one of the above procedures
115       calls the corresponding X procedure and also  saves  the  configuration
116       information  in  Tk's  local structure for the window.  This allows the
117       information to be retrieved quickly by the  application  (using  macros
118       such as Tk_X and Tk_Height) without having to contact the X server.  In
119       addition, if no X window has actually been created for tkwin yet, these
120       procedures  do  not  issue  X  operations or cause event handlers to be
121       invoked;  they save the information in Tk's  local  structure  for  the
122       window;   when  the window is created later, the saved information will
123       be used to configure the window.
124
125       See the X library documentation for details on what these procedures do
126       and how they use their arguments.
127
128       In  the  procedures Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow,
129       Tk_MoveResizeWindow, and Tk_SetWindowBorderWidth, if tkwin is an inter‐
130       nal  window  then  event  handlers  interested  in configure events are
131       invoked immediately, before the procedure returns.  If tkwin is a  top-
132       level window then the event handlers will be invoked later, after X has
133       seen the request and returned an event for it.
134
135       Applications using Tk should never call procedures like  XConfigureWin‐
136       dow directly;  they should always use the corresponding Tk procedures.
137
138       The size and location of a window should only be modified by the appro‐
139       priate geometry manager for that window and never by  a  window  itself
140       (but see Tk_MoveToplevelWindow for moving a top-level window).
141
142       You  may  not  use Tk_ConfigureWindow to change the stacking order of a
143       window (valueMask may not contain the CWSibling or  CWStackMode  bits).
144       To change the stacking order, use the procedure Tk_RestackWindow.
145
146       The  procedure Tk_SetWindowColormap will automatically add tkwin to the
147       TK_COLORMAP_WINDOWS property of its nearest top-level ancestor  if  the
148       new  colormap is different from that of tkwin's parent and tkwin is not
149       already in the TK_COLORMAP_WINDOWS property.
150

BUGS

152       Tk_SetWindowBackgroundPixmap   and   Tk_SetWindowBorderPixmap    differ
153       slightly  from  their Xlib counterparts in that the pixmap argument may
154       not necessarily be deleted immediately after calling one of these  pro‐
155       cedures.   This is because tkwin's window may not exist yet at the time
156       of the call, in which case pixmap is merely saved and used  later  when
157       tkwin's window is actually created.  If you wish to delete pixmap, then
158       call Tk_MakeWindowExist first to be sure that tkwin's window exists and
159       pixmap has been passed to the X server.
160
161       A   similar   problem   occurs   for  the  cursor  argument  passed  to
162       Tk_DefineCursor.  The solution is the same as for pixmaps  above:  call
163       Tk_MakeWindowExist before freeing the cursor.
164

SEE ALSO

166       Tk_MoveToplevelWindow, Tk_RestackWindow
167

KEYWORDS

169       attributes,  border,  color,  configure,  height, pixel, pixmap, width,
170       window, x, y
171
172
173
174Tk                                    4.0                Tk_ConfigureWindow(3)
Impressum