Debian Codegraph @

pod/pTk/ConfigWind.pod

raw
1 # Copyright (c) 1990-1993 The Regents of the University of California.
2 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
3 # See the file "license.terms" for information on usage and redistribution
4 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5 #
6 #
7
8 =head1 NAME
9
10 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
11
12 =for category C Programming
13
14 =head1 SYNOPSIS
15
16 B<#include E<lt>tk.hE<gt>>
17
18 B<Tk_ConfigureWindow>(I<tkwin, valueMask, valuePtr>)
19
20 B<Tk_MoveWindow>(I<tkwin, x, y>)
21
22 B<Tk_ResizeWindow>(I<tkwin, width, height>)
23
24 B<Tk_MoveResizeWindow>(I<tkwin, x, y, width, height>)
25
26 B<Tk_SetWindowBorderWidth>(I<tkwin, borderWidth>)
27
28 B<Tk_ChangeWindowAttributes>(I<tkwin, valueMask, attsPtr>)
29
30 B<Tk_SetWindowBackground>(I<tkwin, pixel>)
31
32 B<Tk_SetWindowBackgroundPixmap>(I<tkwin, pixmap>)
33
34 B<Tk_SetWindowBorder>(I<tkwin, pixel>)
35
36 B<Tk_SetWindowBorderPixmap>(I<tkwin, pixmap>)
37
38 B<Tk_SetWindowColormap>(I<tkwin, colormap>)
39
40 B<Tk_DefineCursor>(I<tkwin, cursor>)
41
42 B<Tk_UndefineCursor>(I<tkwin>)
43
44 =head1 ARGUMENTS
45
46 =over 4
47
48 =item Tk_Window tkwin (in)
49
50 Token for window.
51
52 =item "unsigned int" valueMask (in)
53
54 OR-ed mask of values like B<CWX> or B<CWBorderPixel>,
55 indicating which fields of I<*valuePtr> or I<*attsPtr> to use.
56
57 =item XWindowChanges *valuePtr (in)
58
59 Points to a structure containing new values for the configuration
60 parameters selected by I<valueMask>. Fields not selected
61 by I<valueMask> are ignored.
62
63 =item int x (in)
64
65 New x-coordinate for I<tkwin>'s top left pixel (including
66 border, if any) within tkwin's parent.
67
68 =item int y (in)
69
70 New y-coordinate for I<tkwin>'s top left pixel (including
71 border, if any) within tkwin's parent.
72
73 =item "int" width (in)
74
75 New width for I<tkwin> (interior, not including border).
76
77 =item "int" height (in)
78
79 New height for I<tkwin> (interior, not including border).
80
81 =item "int" borderWidth (in)
82
83 New width for I<tkwin>'s border.
84
85 =item XSetWindowAttributes *attsPtr (in)
86
87 Points to a structure containing new values for the attributes
88 given by the I<valueMask> argument. Attributes not selected
89 by I<valueMask> are ignored.
90
91 =item "unsigned long" pixel (in)
92
93 New background or border color for window.
94
95 =item Pixmap pixmap (in)
96
97 New pixmap to use for background or border of I<tkwin>. WARNING:
98 cannot necessarily be deleted immediately, as for Xlib calls. See
99 note below.
100
101 =item Colormap colormap (in)
102
103 New colormap to use for I<tkwin>.
104
105 =item Tk_Cursor cursor (in)
106
107 New cursor to use for I<tkwin>. If B<None> is specified, then
108 I<tkwin> will not have its own cursor; it will use the cursor
109 of its parent.
110
111 =back
112
113 =head1 DESCRIPTION
114
115 These procedures are analogous to the X library procedures
116 with similar names, such as B<XConfigureWindow>. Each
117 one of the above procedures calls the corresponding X procedure
118 and also saves the configuration information in Tk's local
119 structure for the window. This allows the information to
120 be retrieved quickly by the application (using macros such
121 as B<Tk_X> and B<Tk_Height>) without having to contact
122 the X server. In addition, if no X window has actually been
123 created for I<tkwin> yet, these procedures do not issue
124 X operations or cause event handlers to be invoked; they save
125 the information in Tk's local
126 structure for the window; when the window is created later,
127 the saved information will be used to configure the window.
128
129 See the X library documentation for details on what these
130 procedures do and how they use their arguments.
131
132 In the procedures B<Tk_ConfigureWindow>, B<Tk_MoveWindow>,
133 B<Tk_ResizeWindow>, B<Tk_MoveResizeWindow>, and
134 B<Tk_SetWindowBorderWidth>,
135 if I<tkwin> is an internal window then event handlers interested
136 in configure events are invoked immediately, before the procedure
137 returns. If I<tkwin> is a top-level window
138 then the event handlers will be invoked later, after X has seen
139 the request and returned an event for it.
140
141 Applications using Tk should never call procedures like
142 B<XConfigureWindow> directly; they should always use the
143 corresponding Tk procedures.
144
145 The size and location of a window should only be modified by the
146 appropriate geometry manager for that window and never by a window
147 itself (but see L<Tk::MoveToplev> for moving a top-level
148 window).
149
150 You may not use B<Tk_ConfigureWindow> to change the
151 stacking order of a window (I<valueMask> may not contain the
152 B<CWSibling> or B<CWStackMode> bits).
153 To change the stacking order, use the procedure B<Tk_RestackWindow>.
154
155 The procedure B<Tk_SetWindowColormap> will automatically add
156 I<tkwin> to the B<TK_COLORMAP_WINDOWS> property of its
157 nearest top-level ancestor if the new colormap is different from
158 that of I<tkwin>'s parent and I<tkwin> isn't already in
159 the B<TK_COLORMAP_WINDOWS> property.
160
161 =head1 BUGS
162
163 B<Tk_SetWindowBackgroundPixmap> and B<Tk_SetWindowBorderPixmap>
164 differ slightly from their Xlib counterparts in that the I<pixmap>
165 argument may not necessarily be deleted immediately after calling
166 one of these procedures. This is because I<tkwin>'s window
167 may not exist yet at the time of the call, in which case I<pixmap>
168 is merely saved and used later when I<tkwin>'s window is actually
169 created. If you wish to delete I<pixmap>, then call
170 B<Tk_MakeWindowExist> first to be sure that I<tkwin>'s window exists
171 and I<pixmap> has been passed to the X server.
172
173 A similar problem occurs for the I<cursor> argument passed to
174 B<Tk_DefineCursor>. The solution is the same as for pixmaps above:
175 call B<Tk_MakeWindowExist> before freeing the cursor.
176
177 =head1 SEE ALSO
178
179 L<Tk::MoveToplev>, L<Tk::Restack>
180
181 =head1 KEYWORDS
182
183 attributes, border, color, configure, height, pixel, pixmap, width, window, x, y