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
112

DESCRIPTION

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

BUGS

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

SEE ALSO

169       Tk_MoveToplevelWindow, Tk_RestackWindow
170
171

KEYWORDS

173       attributes,  border,  color,  configure,  height, pixel, pixmap, width,
174       window, x, y
175
176
177
178Tk                                    4.0                Tk_ConfigureWindow(3)
Impressum