OSDN Git Service

touched all tk files to ease next import
[pf3gnuchains/pf3gnuchains4x.git] / tk / doc / wm.n
1 '\"
2 '\" Copyright (c) 1991-1994 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4 '\"
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 '\" 
8 '\" RCS: @(#) $Id$
9 '\" 
10 .so man.macros
11 .TH wm n 4.3 Tk "Tk Built-In Commands"
12 .BS
13 '\" Note:  do not modify the .SH NAME line immediately below!
14 .SH NAME
15 wm \- Communicate with window manager
16 .SH SYNOPSIS
17 \fBwm\fR \fIoption window \fR?\fIargs\fR?
18 .BE
19
20 .SH DESCRIPTION
21 .PP
22 The \fBwm\fR command is used to interact with window managers in
23 order to control such things as the title for a window, its geometry,
24 or the increments in terms of which it may be resized.  The \fBwm\fR
25 command can take any of a number of different forms, depending on
26 the \fIoption\fR argument.  All of the forms expect at least one
27 additional argument, \fIwindow\fR, which must be the path name of a
28 top-level window.
29 .PP
30 The legal forms for the \fBwm\fR command are:
31 .TP
32 \fBwm aspect \fIwindow\fR ?\fIminNumer minDenom maxNumer maxDenom\fR?
33 If \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
34 are all specified, then they will be passed to the window manager
35 and the window manager should use them to enforce a range of
36 acceptable aspect ratios for \fIwindow\fR.  The aspect ratio of
37 \fIwindow\fR (width/length) will be constrained to lie
38 between \fIminNumer\fR/\fIminDenom\fR and \fImaxNumer\fR/\fImaxDenom\fR.
39 If \fIminNumer\fR etc. are all specified as empty strings, then
40 any existing aspect ratio restrictions are removed.
41 If \fIminNumer\fR etc. are specified, then the command returns an
42 empty string.  Otherwise, it returns
43 a Tcl list containing four elements, which are the current values
44 of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
45 (if no aspect restrictions are in effect, then an empty string is
46 returned).
47 .TP
48 \fBwm client \fIwindow\fR ?\fIname\fR?
49 If \fIname\fR is specified, this command stores \fIname\fR (which
50 should be the name of
51 the host on which the application is executing) in \fIwindow\fR's
52 \fBWM_CLIENT_MACHINE\fR property for use by the window manager or
53 session manager.
54 The command returns an empty string in this case.
55 If \fIname\fR isn't specified, the command returns the last name
56 set in a \fBwm client\fR command for \fIwindow\fR.
57 If \fIname\fR is specified as an empty string, the command deletes the
58 \fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR.
59 .TP
60 \fBwm colormapwindows \fIwindow\fR ?\fIwindowList\fR?
61 This command is used to manipulate the \fBWM_COLORMAP_WINDOWS\fR
62 property, which provides information to the window managers about
63 windows that have private colormaps.
64 If \fIwindowList\fR isn't specified, the command returns a list
65 whose elements are the names of the windows in the \fBWM_COLORMAP_WINDOWS\fR
66 property.
67 If \fIwindowList\fR is specified, it consists of a list of window
68 path names;  the command overwrites the \fBWM_COLORMAP_WINDOWS\fR
69 property with the given windows and returns an empty string.
70 The \fBWM_COLORMAP_WINDOWS\fR property should normally contain a
71 list of the internal windows within \fIwindow\fR whose colormaps differ
72 from their parents.
73 The order of the windows in the property indicates a priority order:
74 the window manager will attempt to install as many colormaps as possible
75 from the head of this list when \fIwindow\fR gets the colormap focus.
76 If \fIwindow\fR is not included among the windows in \fIwindowList\fR,
77 Tk implicitly adds it at the end of the \fBWM_COLORMAP_WINDOWS\fR
78 property, so that its colormap is lowest in priority.
79 If \fBwm colormapwindows\fR is not invoked, Tk will automatically set
80 the property for each top-level window to all the internal windows
81 whose colormaps differ from their parents, followed by the top-level
82 itself;  the order of the internal windows is undefined.
83 See the ICCCM documentation for more information on the
84 \fBWM_COLORMAP_WINDOWS\fR property.
85 .TP
86 \fBwm command \fIwindow\fR ?\fIvalue\fR?
87 If \fIvalue\fR is specified, this command stores \fIvalue\fR in \fIwindow\fR's
88 \fBWM_COMMAND\fR property for use by the window manager or
89 session manager and returns an empty string.
90 \fIValue\fR must have proper list structure;  the elements should
91 contain the words of the command used to invoke the application.
92 If \fIvalue\fR isn't specified then the command returns the last value
93 set in a \fBwm command\fR command for \fIwindow\fR.
94 If \fIvalue\fR is specified as an empty string, the command
95 deletes the \fBWM_COMMAND\fR property from \fIwindow\fR.
96 .TP
97 \fBwm deiconify \fIwindow\fR
98 Arrange for \fIwindow\fR to be displayed in normal (non-iconified) form.
99 This is done by mapping the window.  If the window has never been
100 mapped then this command will not map the window, but it will ensure
101 that when the window is first mapped it will be displayed
102 in de-iconified form.  On Windows, a deiconified window will also be
103 raised and be given the focus (made the active window).
104 Returns an empty string.
105 .TP
106 \fBwm focusmodel \fIwindow\fR ?\fBactive\fR|\fBpassive\fR?
107 If \fBactive\fR or \fBpassive\fR is supplied as an optional argument
108 to the command, then it specifies the focus model for \fIwindow\fR.
109 In this case the command returns an empty string.  If no additional
110 argument is supplied, then the command returns the current focus
111 model for \fIwindow\fR.
112 An \fBactive\fR focus model means that \fIwindow\fR will claim the
113 input focus for itself or its descendants, even at times when
114 the focus is currently in some other application.  \fBPassive\fR means that
115 \fIwindow\fR will never claim the focus for itself:  the window manager
116 should give the focus to \fIwindow\fR at appropriate times.  However,
117 once the focus has been given to \fIwindow\fR or one of its descendants,
118 the application may re-assign the focus among \fIwindow\fR's descendants.
119 The focus model defaults to \fBpassive\fR, and Tk's \fBfocus\fR command
120 assumes a passive model of focusing.
121 .TP
122 \fBwm frame \fIwindow\fR
123 .VS
124 If \fIwindow\fR has been reparented by the window manager into a
125 decorative frame, the command returns the platform specific window
126 identifier for the outermost frame that contains \fIwindow\fR (the
127 window whose parent is the root or virtual root).  If \fIwindow\fR
128 hasn't been reparented by the window manager then the command returns
129 the platform specific window identifier for \fIwindow\fR.
130 .VE
131 .TP
132 \fBwm geometry \fIwindow\fR ?\fInewGeometry\fR?
133 If \fInewGeometry\fR is specified, then the geometry of \fIwindow\fR
134 is changed and an empty string is returned.  Otherwise the current
135 geometry for \fIwindow\fR is returned (this is the most recent
136 geometry specified either by manual resizing or
137 in a \fBwm geometry\fR command).  \fINewGeometry\fR has
138 the form \fB=\fIwidth\fBx\fIheight\fB\(+-\fIx\fB\(+-\fIy\fR, where
139 any of \fB=\fR, \fIwidth\fBx\fIheight\fR, or \fB\(+-\fIx\fB\(+-\fIy\fR
140 may be omitted.  \fIWidth\fR and \fIheight\fR are positive integers
141 specifying the desired dimensions of \fIwindow\fR.  If \fIwindow\fR
142 is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions
143 are specified in grid units;  otherwise they are specified in pixel
144 units.  \fIX\fR and \fIy\fR specify the desired location of
145 \fIwindow\fR on the screen, in pixels.
146 If \fIx\fR is preceded by \fB+\fR, it specifies
147 the number of pixels between the left edge of the screen and the left
148 edge of \fIwindow\fR's border;  if preceded by \fB\-\fR then
149 \fIx\fR specifies the number of pixels
150 between the right edge of the screen and the right edge of \fIwindow\fR's
151 border.  If \fIy\fR is preceded by \fB+\fR then it specifies the
152 number of pixels between the top of the screen and the top
153 of \fIwindow\fR's border;  if \fIy\fR is preceded by \fB\-\fR then
154 it specifies the number of pixels between the bottom of \fIwindow\fR's
155 border and the bottom of the screen.
156 If \fInewGeometry\fR is specified as an empty string then any
157 existing user-specified geometry for \fIwindow\fR is cancelled, and
158 the window will revert to the size requested internally by its
159 widgets.
160 .TP
161 \fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR?
162 This command indicates that \fIwindow\fR is to be managed as a
163 gridded window.
164 It also specifies the relationship between grid units and pixel units.
165 \fIBaseWidth\fR and \fIbaseHeight\fR specify the number of grid
166 units corresponding to the pixel dimensions requested internally
167 by \fIwindow\fR using \fBTk_GeometryRequest\fR.  \fIWidthInc\fR
168 and \fIheightInc\fR specify the number of pixels in each horizontal
169 and vertical grid unit.
170 These four values determine a range of acceptable sizes for
171 \fIwindow\fR, corresponding to grid-based widths and heights
172 that are non-negative integers.
173 Tk will pass this information to the window manager;  during
174 manual resizing, the window manager will restrict the window's size
175 to one of these acceptable sizes.
176 Furthermore, during manual resizing the window manager will display
177 the window's current size in terms of grid units rather than pixels.
178 If \fIbaseWidth\fR etc. are all specified as empty strings, then
179 \fIwindow\fR will no longer be managed as a gridded window.  If
180 \fIbaseWidth\fR etc. are specified then the return value is an
181 empty string.
182 Otherwise the return value is a Tcl list containing
183 four elements corresponding to the current \fIbaseWidth\fR,
184 \fIbaseHeight\fR, \fIwidthInc\fR, and \fIheightInc\fR;  if
185 \fIwindow\fR is not currently gridded, then an empty string
186 is returned.
187 Note: this command should not be needed very often, since the
188 \fBTk_SetGrid\fR library procedure and the \fBsetGrid\fR option
189 provide easier access to the same functionality.
190 .TP
191 \fBwm group \fIwindow\fR ?\fIpathName\fR?
192 If \fIpathName\fR is specified, it gives the path name for the leader of
193 a group of related windows.  The window manager may use this information,
194 for example, to unmap all of the windows in a group when the group's
195 leader is iconified.  \fIPathName\fR may be specified as an empty string to
196 remove \fIwindow\fR from any group association.  If \fIpathName\fR is
197 specified then the command returns an empty string;  otherwise it
198 returns the path name of \fIwindow\fR's current group leader, or an empty
199 string if \fIwindow\fR isn't part of any group.
200 .TP
201 \fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR?
202 If \fIbitmap\fR is specified, then it names a bitmap in the standard
203 forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details).
204 This bitmap is passed to the window manager to be displayed in
205 \fIwindow\fR's icon, and the command returns an empty string.  If
206 an empty string is specified for \fIbitmap\fR, then any current icon
207 bitmap is cancelled for \fIwindow\fR.
208 If \fIbitmap\fR is specified then the command returns an empty string.
209 Otherwise it returns the name of
210 the current icon bitmap associated with \fIwindow\fR, or an empty
211 string if \fIwindow\fR has no icon bitmap.
212 .TP
213 \fBwm iconify \fIwindow\fR
214 Arrange for \fIwindow\fR to be iconified.  It \fIwindow\fR hasn't
215 yet been mapped for the first time, this command will arrange for
216 it to appear in the iconified state when it is eventually mapped.
217 .TP
218 \fBwm iconmask \fIwindow\fR ?\fIbitmap\fR?
219 If \fIbitmap\fR is specified, then it names a bitmap in the standard
220 forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details).
221 This bitmap is passed to the window manager to be used as a mask
222 in conjunction with the \fBiconbitmap\fR option:  where the mask
223 has zeroes no icon will be displayed;  where it has ones, the bits
224 from the icon bitmap will be displayed.  If
225 an empty string is specified for \fIbitmap\fR then any current icon
226 mask is cancelled for \fIwindow\fR (this is equivalent to specifying
227 a bitmap of all ones).  If \fIbitmap\fR is specified
228 then the command returns an empty string.  Otherwise it
229 returns the name of the current icon mask associated with
230 \fIwindow\fR, or an empty string if no mask is in effect.
231 .TP
232 \fBwm iconname \fIwindow\fR ?\fInewName\fR?
233 If \fInewName\fR is specified, then it is passed to the window
234 manager;  the window manager should display \fInewName\fR inside
235 the icon associated with \fIwindow\fR.  In this case an empty
236 string is returned as result.  If \fInewName\fR isn't specified
237 then the command returns the current icon name for \fIwindow\fR,
238 or an empty string if no icon name has been specified (in this
239 case the window manager will normally display the window's title,
240 as specified with the \fBwm title\fR command).
241 .TP
242 \fBwm iconposition \fIwindow\fR ?\fIx y\fR?
243 If \fIx\fR and \fIy\fR are specified, they are passed to the window
244 manager as a hint about where to position the icon for \fIwindow\fR.
245 In this case an empty string is returned.  If \fIx\fR and \fIy\fR are
246 specified as empty strings then any existing icon position hint is cancelled.
247 If neither \fIx\fR nor \fIy\fR is specified, then the command returns
248 a Tcl list containing two values, which are the current icon position
249 hints (if no hints are in effect then an empty string is returned).
250 .TP
251 \fBwm iconwindow \fIwindow\fR ?\fIpathName\fR?
252 If \fIpathName\fR is specified, it is the path name for a window to
253 use as icon for \fIwindow\fR: when \fIwindow\fR is iconified then
254 \fIpathName\fR will be mapped to serve as icon, and when \fIwindow\fR
255 is de-iconified then \fIpathName\fR will be unmapped again.  If
256 \fIpathName\fR is specified as an empty string then any existing
257 icon window association for \fIwindow\fR will be cancelled.  If
258 the \fIpathName\fR argument is specified then an empty string is
259 returned.  Otherwise the command returns the path name of the
260 current icon window for \fIwindow\fR, or an empty string if there
261 is no icon window currently specified for \fIwindow\fR.
262 Button press events are disabled for \fIwindow\fR as long as it is
263 an icon window;  this is needed in order to allow window managers
264 to ``own'' those events.
265 Note: not all window managers support the notion of an icon window.
266 .TP
267 \fBwm maxsize \fIwindow\fR ?\fIwidth height\fR?
268 If \fIwidth\fR and \fIheight\fR are specified, they give
269 the maximum permissible dimensions for \fIwindow\fR.
270 For gridded windows the dimensions are specified in
271 grid units;  otherwise they are specified in pixel units.
272 The window manager will restrict the window's dimensions to be
273 less than or equal to \fIwidth\fR and \fIheight\fR.
274 If \fIwidth\fR and \fIheight\fR are
275 specified, then the command returns an empty string.  Otherwise
276 it returns a Tcl list with two elements, which are the
277 maximum width and height currently in effect.
278 The maximum size defaults to the size of the screen.
279 If resizing has been disabled with the \fBwm resizable\fR command,
280 then this command has no effect.
281 See the sections on geometry management below for more information.
282 .TP
283 \fBwm minsize \fIwindow\fR ?\fIwidth height\fR?
284 If \fIwidth\fR and \fIheight\fR are specified, they give the
285 minimum permissible dimensions for \fIwindow\fR.
286 For gridded windows the dimensions are specified in
287 grid units;  otherwise they are specified in pixel units.
288 The window manager will restrict the window's dimensions to be
289 greater than or equal to \fIwidth\fR and \fIheight\fR.
290 If \fIwidth\fR and \fIheight\fR are
291 specified, then the command returns an empty string.  Otherwise
292 it returns a Tcl list with two elements, which are the
293 minimum width and height currently in effect.
294 The minimum size defaults to one pixel in each dimension.
295 If resizing has been disabled with the \fBwm resizable\fR command,
296 then this command has no effect.
297 See the sections on geometry management below for more information.
298 .TP
299 \fBwm overrideredirect \fIwindow\fR ?\fIboolean\fR?
300 If \fIboolean\fR is specified, it must have a proper boolean form and
301 the override-redirect flag for \fIwindow\fR is set to that value.
302 If \fIboolean\fR is not specified then \fB1\fR or \fB0\fR is
303 returned to indicate whether or not the override-redirect flag
304 is currently set for \fIwindow\fR.
305 Setting the override-redirect flag for a window causes
306 it to be ignored by the window manager;  among other things, this means
307 that the window will not be reparented from the root window into a
308 decorative frame and the user will not be able to manipulate the
309 window using the normal window manager mechanisms.
310 .TP
311 \fBwm positionfrom \fIwindow\fR ?\fIwho\fR?
312 If \fIwho\fR is specified, it must be either \fBprogram\fR or
313 \fBuser\fR, or an abbreviation of one of these two.  It indicates
314 whether \fIwindow\fR's current position was requested by the
315 program or by the user.  Many window managers ignore program-requested
316 initial positions and ask the user to manually position the window;  if
317 \fBuser\fR is specified then the window manager should position the
318 window at the given place without asking the user for assistance.
319 If \fIwho\fR is specified as an empty string, then the current position
320 source is cancelled.
321 If \fIwho\fR is specified, then the command returns an empty string.
322 Otherwise it returns \fBuser\fR or \fBprogram\fR to indicate the
323 source of the window's current position, or an empty string if
324 no source has been specified yet.  Most window managers interpret
325 ``no source'' as equivalent to \fBprogram\fR.
326 Tk will automatically set the position source to \fBuser\fR
327 when a \fBwm geometry\fR command is invoked, unless the source has
328 been set explicitly to \fBprogram\fR.
329 .TP
330 \fBwm protocol \fIwindow\fR ?\fIname\fR? ?\fIcommand\fR?
331 This command is used to manage window manager protocols such as
332 \fBWM_DELETE_WINDOW\fR.
333 \fIName\fR is the name of an atom corresponding to a window manager
334 protocol, such as \fBWM_DELETE_WINDOW\fR or \fBWM_SAVE_YOURSELF\fR
335 or \fBWM_TAKE_FOCUS\fR.
336 If both \fIname\fR and \fIcommand\fR are specified, then \fIcommand\fR
337 is associated with the protocol specified by \fIname\fR.
338 \fIName\fR will be added to \fIwindow\fR's \fBWM_PROTOCOLS\fR
339 property to tell the window manager that the application has a
340 protocol handler for \fIname\fR, and \fIcommand\fR will
341 be invoked in the future whenever the window manager sends a
342 message to the client for that protocol.
343 In this case the command returns an empty string.
344 If \fIname\fR is specified but \fIcommand\fR isn't, then the current
345 command for \fIname\fR is returned, or an empty string if there
346 is no handler defined for \fIname\fR.
347 If \fIcommand\fR is specified as an empty string then the current
348 handler for \fIname\fR is deleted and it is removed from the
349 \fBWM_PROTOCOLS\fR property on \fIwindow\fR;  an empty string is
350 returned.
351 Lastly, if neither \fIname\fR nor \fIcommand\fR is specified, the
352 command returns a list of all the protocols for which handlers
353 are currently defined for \fIwindow\fR.
354 .RS
355 .PP
356 Tk always defines a protocol handler for \fBWM_DELETE_WINDOW\fR, even if
357 you haven't asked for one with \fBwm protocol\fR.
358 If a \fBWM_DELETE_WINDOW\fR message arrives when you haven't defined
359 a handler, then Tk handles the message by destroying the window for
360 which it was received.
361 .RE
362 .TP
363 \fBwm resizable \fIwindow\fR ?\fIwidth height\fR?
364 This command controls whether or not the user may interactively
365 resize a top-level window.  If \fIwidth\fR and \fIheight\fR are
366 specified, they are boolean values that determine whether the
367 width and height of \fIwindow\fR may be modified by the user.
368 In this case the command returns an empty string.
369 If \fIwidth\fR and \fIheight\fR are omitted then the command
370 returns a list with two 0/1 elements that indicate whether the
371 width and height of \fIwindow\fR are currently resizable.
372 By default, windows are resizable in both dimensions.
373 If resizing is disabled, then the window's size will be the size
374 from the most recent interactive resize or \fBwm geometry\fR
375 command.  If there has been no such operation then
376 the window's natural size will be used.
377 .TP
378 \fBwm sizefrom \fIwindow\fR ?\fIwho\fR?
379 If \fIwho\fR is specified, it must be either \fBprogram\fR or
380 \fBuser\fR, or an abbreviation of one of these two.  It indicates
381 whether \fIwindow\fR's current size was requested by the
382 program or by the user.  Some window managers ignore program-requested
383 sizes and ask the user to manually size the window;  if
384 \fBuser\fR is specified then the window manager should give the
385 window its specified size without asking the user for assistance.
386 If \fIwho\fR is specified as an empty string, then the current size
387 source is cancelled.
388 If \fIwho\fR is specified, then the command returns an empty string.
389 Otherwise it returns \fBuser\fR or \fBwindow\fR to indicate the
390 source of the window's current size, or an empty string if
391 no source has been specified yet.  Most window managers interpret
392 ``no source'' as equivalent to \fBprogram\fR.
393 .TP
394 \fBwm state \fIwindow\fR ?newstate?
395 If \fInewstate\fR is specified, the window will be set to the new state,
396 otherwise it returns the current state of \fIwindow\fR: either
397 \fBnormal\fR, \fBiconic\fR, \fBwithdrawn\fR, \fBicon\fR, or (Windows only)
398 \fBzoomed\fR.  The difference between \fBiconic\fR and \fBicon\fR is that
399 \fBiconic\fR refers to a window that has been iconified (e.g., with the
400 \fBwm iconify\fR command) while \fBicon\fR refers to a window whose only
401 purpose is to serve as the icon for some other window (via the \fBwm
402 iconwindow\fR command).  The \fBicon\fR state cannot be set.
403 .TP
404 \fBwm title \fIwindow\fR ?\fIstring\fR?
405 If \fIstring\fR is specified, then it will be passed to the window
406 manager for use as the title for \fIwindow\fR (the window manager
407 should display this string in \fIwindow\fR's title bar).  In this
408 case the command returns an empty string.  If \fIstring\fR isn't
409 specified then the command returns the current title for the
410 \fIwindow\fR.  The title for a window defaults to its name.
411 .TP
412 \fBwm transient \fIwindow\fR ?\fImaster\fR?
413 If \fImaster\fR is specified, then the window manager is informed
414 that \fIwindow\fR is a transient window (e.g. pull-down menu) working
415 on behalf of \fImaster\fR (where \fImaster\fR is the
416 path name for a top-level window).  Some window managers will use
417 this information to manage \fIwindow\fR specially.  If \fImaster\fR
418 is specified as an empty string then \fIwindow\fR is marked as not
419 being a transient window any more.  If \fImaster\fR is specified,
420 then the command returns an empty string.  Otherwise the command
421 returns the path name of \fIwindow\fR's current master, or an
422 empty string if \fIwindow\fR isn't currently a transient window.
423 .TP
424 \fBwm withdraw \fIwindow\fR
425 Arranges for \fIwindow\fR to be withdrawn from the screen.  This
426 causes the window to be unmapped and forgotten about by the window
427 manager.  If the window
428 has never been mapped, then this command
429 causes the window to be mapped in the withdrawn state.  Not all
430 window managers appear to know how to handle windows that are
431 mapped in the withdrawn state.
432 Note: it sometimes seems to be necessary to withdraw a
433 window and then re-map it (e.g. with \fBwm deiconify\fR) to get some
434 window managers to pay attention to changes in window attributes
435 such as group.
436
437 .SH "GEOMETRY MANAGEMENT"
438 .PP
439 By default a top-level window appears on the screen in its
440 \fInatural size\fR, which is the one determined internally by its
441 widgets and geometry managers.
442 If the natural size of a top-level window changes, then the window's size
443 changes to match.
444 A top-level window can be given a size other than its natural size in two ways.
445 First, the user can resize the window manually using the facilities
446 of the window manager, such as resize handles.
447 Second, the application can request a particular size for a
448 top-level window using the \fBwm geometry\fR command.
449 These two cases are handled identically by Tk;  in either case,
450 the requested size overrides the natural size.
451 You can return the window to its natural by invoking \fBwm geometry\fR
452 with an empty \fIgeometry\fR string.
453 .PP
454 Normally a top-level window can have any size from one pixel in each
455 dimension up to the size of its screen.
456 However, you can use the \fBwm minsize\fR and \fBwm maxsize\fR commands
457 to limit the range of allowable sizes.
458 The range set by \fBwm minsize\fR and \fBwm maxsize\fR applies to
459 all forms of resizing, including the window's natural size as
460 well as manual resizes and the \fBwm geometry\fR command.
461 You can also use the command \fBwm resizable\fR to completely
462 disable interactive resizing in one or both dimensions.
463
464 .SH "GRIDDED GEOMETRY MANAGEMENT"
465 .PP
466 Gridded geometry management occurs when one of the widgets of an
467 application supports a range of useful sizes.
468 This occurs, for example, in a text editor where the scrollbars,
469 menus, and other adornments are fixed in size but the edit widget
470 can support any number of lines of text or characters per line.
471 In this case, it is usually desirable to let the user specify the
472 number of lines or characters-per-line, either with the
473 \fBwm geometry\fR command or by interactively resizing the window.
474 In the case of text, and in other interesting cases also, only
475 discrete sizes of the window make sense, such as integral numbers
476 of lines and characters-per-line;  arbitrary pixel sizes are not useful.
477 .PP
478 Gridded geometry management provides support for this kind of
479 application.
480 Tk (and the window manager) assume that there is a grid of some
481 sort within the application and that the application should be
482 resized in terms of \fIgrid units\fR rather than pixels.
483 Gridded geometry management is typically invoked by turning on
484 the \fBsetGrid\fR option for a widget;  it can also be invoked
485 with the \fBwm grid\fR command or by calling \fBTk_SetGrid\fR.
486 In each of these approaches the particular widget (or sometimes
487 code in the application as a whole) specifies the relationship between 
488 integral grid sizes for the window and pixel sizes.
489 To return to non-gridded geometry management, invoke
490 \fBwm grid\fR with empty argument strings.
491 .PP
492 When gridded geometry management is enabled then all the dimensions specified
493 in \fBwm minsize\fR, \fBwm maxsize\fR, and \fBwm geometry\fR commands
494 are treated as grid units rather than pixel units.
495 Interactive resizing is also carried out in even numbers of grid units
496 rather than pixels.
497
498 .SH BUGS
499 .PP
500 Most existing window managers appear to have bugs that affect the
501 operation of the \fBwm\fR command.  For example, some changes won't
502 take effect if the window is already active:  the window will have
503 to be withdrawn and de-iconified in order to make the change happen.
504
505 .SH KEYWORDS
506 aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager
507