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