Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | '\" |
2 | '\" Copyright (c) 1990-1994 The Regents of the University of California. | |
3 | '\" Copyright (c) 1994-1997 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: winfo.n,v 1.3.2.1 2004/10/28 12:25:22 dkf Exp $ | |
9 | '\" | |
10 | '\" The definitions below are for supplemental macros used in Tcl/Tk | |
11 | '\" manual entries. | |
12 | '\" | |
13 | '\" .AP type name in/out ?indent? | |
14 | '\" Start paragraph describing an argument to a library procedure. | |
15 | '\" type is type of argument (int, etc.), in/out is either "in", "out", | |
16 | '\" or "in/out" to describe whether procedure reads or modifies arg, | |
17 | '\" and indent is equivalent to second arg of .IP (shouldn't ever be | |
18 | '\" needed; use .AS below instead) | |
19 | '\" | |
20 | '\" .AS ?type? ?name? | |
21 | '\" Give maximum sizes of arguments for setting tab stops. Type and | |
22 | '\" name are examples of largest possible arguments that will be passed | |
23 | '\" to .AP later. If args are omitted, default tab stops are used. | |
24 | '\" | |
25 | '\" .BS | |
26 | '\" Start box enclosure. From here until next .BE, everything will be | |
27 | '\" enclosed in one large box. | |
28 | '\" | |
29 | '\" .BE | |
30 | '\" End of box enclosure. | |
31 | '\" | |
32 | '\" .CS | |
33 | '\" Begin code excerpt. | |
34 | '\" | |
35 | '\" .CE | |
36 | '\" End code excerpt. | |
37 | '\" | |
38 | '\" .VS ?version? ?br? | |
39 | '\" Begin vertical sidebar, for use in marking newly-changed parts | |
40 | '\" of man pages. The first argument is ignored and used for recording | |
41 | '\" the version when the .VS was added, so that the sidebars can be | |
42 | '\" found and removed when they reach a certain age. If another argument | |
43 | '\" is present, then a line break is forced before starting the sidebar. | |
44 | '\" | |
45 | '\" .VE | |
46 | '\" End of vertical sidebar. | |
47 | '\" | |
48 | '\" .DS | |
49 | '\" Begin an indented unfilled display. | |
50 | '\" | |
51 | '\" .DE | |
52 | '\" End of indented unfilled display. | |
53 | '\" | |
54 | '\" .SO | |
55 | '\" Start of list of standard options for a Tk widget. The | |
56 | '\" options follow on successive lines, in four columns separated | |
57 | '\" by tabs. | |
58 | '\" | |
59 | '\" .SE | |
60 | '\" End of list of standard options for a Tk widget. | |
61 | '\" | |
62 | '\" .OP cmdName dbName dbClass | |
63 | '\" Start of description of a specific option. cmdName gives the | |
64 | '\" option's name as specified in the class command, dbName gives | |
65 | '\" the option's name in the option database, and dbClass gives | |
66 | '\" the option's class in the option database. | |
67 | '\" | |
68 | '\" .UL arg1 arg2 | |
69 | '\" Print arg1 underlined, then print arg2 normally. | |
70 | '\" | |
71 | '\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $ | |
72 | '\" | |
73 | '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. | |
74 | .if t .wh -1.3i ^B | |
75 | .nr ^l \n(.l | |
76 | .ad b | |
77 | '\" # Start an argument description | |
78 | .de AP | |
79 | .ie !"\\$4"" .TP \\$4 | |
80 | .el \{\ | |
81 | . ie !"\\$2"" .TP \\n()Cu | |
82 | . el .TP 15 | |
83 | .\} | |
84 | .ta \\n()Au \\n()Bu | |
85 | .ie !"\\$3"" \{\ | |
86 | \&\\$1 \\fI\\$2\\fP (\\$3) | |
87 | .\".b | |
88 | .\} | |
89 | .el \{\ | |
90 | .br | |
91 | .ie !"\\$2"" \{\ | |
92 | \&\\$1 \\fI\\$2\\fP | |
93 | .\} | |
94 | .el \{\ | |
95 | \&\\fI\\$1\\fP | |
96 | .\} | |
97 | .\} | |
98 | .. | |
99 | '\" # define tabbing values for .AP | |
100 | .de AS | |
101 | .nr )A 10n | |
102 | .if !"\\$1"" .nr )A \\w'\\$1'u+3n | |
103 | .nr )B \\n()Au+15n | |
104 | .\" | |
105 | .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n | |
106 | .nr )C \\n()Bu+\\w'(in/out)'u+2n | |
107 | .. | |
108 | .AS Tcl_Interp Tcl_CreateInterp in/out | |
109 | '\" # BS - start boxed text | |
110 | '\" # ^y = starting y location | |
111 | '\" # ^b = 1 | |
112 | .de BS | |
113 | .br | |
114 | .mk ^y | |
115 | .nr ^b 1u | |
116 | .if n .nf | |
117 | .if n .ti 0 | |
118 | .if n \l'\\n(.lu\(ul' | |
119 | .if n .fi | |
120 | .. | |
121 | '\" # BE - end boxed text (draw box now) | |
122 | .de BE | |
123 | .nf | |
124 | .ti 0 | |
125 | .mk ^t | |
126 | .ie n \l'\\n(^lu\(ul' | |
127 | .el \{\ | |
128 | .\" Draw four-sided box normally, but don't draw top of | |
129 | .\" box if the box started on an earlier page. | |
130 | .ie !\\n(^b-1 \{\ | |
131 | \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
132 | .\} | |
133 | .el \}\ | |
134 | \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
135 | .\} | |
136 | .\} | |
137 | .fi | |
138 | .br | |
139 | .nr ^b 0 | |
140 | .. | |
141 | '\" # VS - start vertical sidebar | |
142 | '\" # ^Y = starting y location | |
143 | '\" # ^v = 1 (for troff; for nroff this doesn't matter) | |
144 | .de VS | |
145 | .if !"\\$2"" .br | |
146 | .mk ^Y | |
147 | .ie n 'mc \s12\(br\s0 | |
148 | .el .nr ^v 1u | |
149 | .. | |
150 | '\" # VE - end of vertical sidebar | |
151 | .de VE | |
152 | .ie n 'mc | |
153 | .el \{\ | |
154 | .ev 2 | |
155 | .nf | |
156 | .ti 0 | |
157 | .mk ^t | |
158 | \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' | |
159 | .sp -1 | |
160 | .fi | |
161 | .ev | |
162 | .\} | |
163 | .nr ^v 0 | |
164 | .. | |
165 | '\" # Special macro to handle page bottom: finish off current | |
166 | '\" # box/sidebar if in box/sidebar mode, then invoked standard | |
167 | '\" # page bottom macro. | |
168 | .de ^B | |
169 | .ev 2 | |
170 | 'ti 0 | |
171 | 'nf | |
172 | .mk ^t | |
173 | .if \\n(^b \{\ | |
174 | .\" Draw three-sided box if this is the box's first page, | |
175 | .\" draw two sides but no top otherwise. | |
176 | .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
177 | .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
178 | .\} | |
179 | .if \\n(^v \{\ | |
180 | .nr ^x \\n(^tu+1v-\\n(^Yu | |
181 | \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c | |
182 | .\} | |
183 | .bp | |
184 | 'fi | |
185 | .ev | |
186 | .if \\n(^b \{\ | |
187 | .mk ^y | |
188 | .nr ^b 2 | |
189 | .\} | |
190 | .if \\n(^v \{\ | |
191 | .mk ^Y | |
192 | .\} | |
193 | .. | |
194 | '\" # DS - begin display | |
195 | .de DS | |
196 | .RS | |
197 | .nf | |
198 | .sp | |
199 | .. | |
200 | '\" # DE - end display | |
201 | .de DE | |
202 | .fi | |
203 | .RE | |
204 | .sp | |
205 | .. | |
206 | '\" # SO - start of list of standard options | |
207 | .de SO | |
208 | .SH "STANDARD OPTIONS" | |
209 | .LP | |
210 | .nf | |
211 | .ta 5.5c 11c | |
212 | .ft B | |
213 | .. | |
214 | '\" # SE - end of list of standard options | |
215 | .de SE | |
216 | .fi | |
217 | .ft R | |
218 | .LP | |
219 | See the \\fBoptions\\fR manual entry for details on the standard options. | |
220 | .. | |
221 | '\" # OP - start of full description for a single option | |
222 | .de OP | |
223 | .LP | |
224 | .nf | |
225 | .ta 4c | |
226 | Command-Line Name: \\fB\\$1\\fR | |
227 | Database Name: \\fB\\$2\\fR | |
228 | Database Class: \\fB\\$3\\fR | |
229 | .fi | |
230 | .IP | |
231 | .. | |
232 | '\" # CS - begin code excerpt | |
233 | .de CS | |
234 | .RS | |
235 | .nf | |
236 | .ta .25i .5i .75i 1i | |
237 | .. | |
238 | '\" # CE - end code excerpt | |
239 | .de CE | |
240 | .fi | |
241 | .RE | |
242 | .. | |
243 | .de UL | |
244 | \\$1\l'|0\(ul'\\$2 | |
245 | .. | |
246 | .TH winfo n 4.3 Tk "Tk Built-In Commands" | |
247 | .BS | |
248 | '\" Note: do not modify the .SH NAME line immediately below! | |
249 | .SH NAME | |
250 | winfo \- Return window-related information | |
251 | .SH SYNOPSIS | |
252 | \fBwinfo\fR \fIoption \fR?\fIarg arg ...\fR? | |
253 | .BE | |
254 | ||
255 | .SH DESCRIPTION | |
256 | .PP | |
257 | The \fBwinfo\fR command is used to retrieve information about windows | |
258 | managed by Tk. It can take any of a number of different forms, | |
259 | depending on the \fIoption\fR argument. The legal forms are: | |
260 | .TP | |
261 | \fBwinfo atom \fR?\fB\-displayof \fIwindow\fR? \fIname\fR | |
262 | Returns a decimal string giving the integer identifier for the | |
263 | atom whose name is \fIname\fR. If no atom exists with the name | |
264 | \fIname\fR then a new one is created. | |
265 | If the \fB\-displayof\fR option is given then the atom is looked | |
266 | up on the display of \fIwindow\fR; otherwise it is looked up on | |
267 | the display of the application's main window. | |
268 | .TP | |
269 | \fBwinfo atomname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR | |
270 | Returns the textual name for the atom whose integer identifier is | |
271 | \fIid\fR. | |
272 | If the \fB\-displayof\fR option is given then the identifier is looked | |
273 | up on the display of \fIwindow\fR; otherwise it is looked up on | |
274 | the display of the application's main window. | |
275 | This command is the inverse of the \fBwinfo atom\fR command. | |
276 | It generates an error if no such atom exists. | |
277 | .TP | |
278 | \fBwinfo cells \fIwindow\fR | |
279 | Returns a decimal string giving the number of cells in the | |
280 | color map for \fIwindow\fR. | |
281 | .TP | |
282 | \fBwinfo children \fIwindow\fR | |
283 | Returns a list containing the path names of all the children | |
284 | of \fIwindow\fR. Top-level windows are returned as children | |
285 | of their logical parents. The list is in stacking order, with | |
286 | the lowest window first, except for Top-level windows which | |
287 | are not returned in stacking order. Use the \fBwm stackorder\fR | |
288 | command to query the stacking order of Top-level windows. | |
289 | .TP | |
290 | \fBwinfo class \fIwindow\fR | |
291 | Returns the class name for \fIwindow\fR. | |
292 | .TP | |
293 | \fBwinfo colormapfull \fIwindow\fR | |
294 | Returns 1 if the colormap for \fIwindow\fR is known to be full, 0 | |
295 | otherwise. The colormap for a window is ``known'' to be full if the last | |
296 | attempt to allocate a new color on that window failed and this | |
297 | application hasn't freed any colors in the colormap since the | |
298 | failed allocation. | |
299 | .TP | |
300 | \fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR | |
301 | Returns the path name for the window containing the point given | |
302 | by \fIrootX\fR and \fIrootY\fR. | |
303 | \fIRootX\fR and \fIrootY\fR are specified in screen units (i.e. | |
304 | any form acceptable to \fBTk_GetPixels\fR) in the coordinate | |
305 | system of the root window (if a virtual-root window manager is in | |
306 | use then the coordinate system of the virtual root window is used). | |
307 | If the \fB\-displayof\fR option is given then the coordinates refer | |
308 | to the screen containing \fIwindow\fR; otherwise they refer to the | |
309 | screen of the application's main window. | |
310 | If no window in this application contains the point then an empty | |
311 | string is returned. | |
312 | In selecting the containing window, children are given higher priority | |
313 | than parents and among siblings the highest one in the stacking order is | |
314 | chosen. | |
315 | .TP | |
316 | \fBwinfo depth \fIwindow\fR | |
317 | Returns a decimal string giving the depth of \fIwindow\fR (number | |
318 | of bits per pixel). | |
319 | .TP | |
320 | \fBwinfo exists \fIwindow\fR | |
321 | Returns 1 if there exists a window named \fIwindow\fR, 0 if no such | |
322 | window exists. | |
323 | .TP | |
324 | \fBwinfo fpixels \fIwindow\fR \fInumber\fR | |
325 | Returns a floating-point value giving the number of pixels | |
326 | in \fIwindow\fR corresponding to the distance given by \fInumber\fR. | |
327 | \fINumber\fR may be specified in any of the forms acceptable | |
328 | to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''. | |
329 | The return value may be fractional; for an integer value, use | |
330 | \fBwinfo pixels\fR. | |
331 | .TP | |
332 | \fBwinfo geometry \fIwindow\fR | |
333 | Returns the geometry for \fIwindow\fR, in the form | |
334 | \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR. All dimensions are | |
335 | in pixels. | |
336 | .TP | |
337 | \fBwinfo height \fIwindow\fR | |
338 | Returns a decimal string giving \fIwindow\fR's height in pixels. | |
339 | When a window is first created its height will be 1 pixel; the | |
340 | height will eventually be changed by a geometry manager to fulfill | |
341 | the window's needs. | |
342 | If you need the true height immediately after creating a widget, | |
343 | invoke \fBupdate\fR to force the geometry manager to arrange it, | |
344 | or use \fBwinfo reqheight\fR to get the window's requested height | |
345 | instead of its actual height. | |
346 | .TP | |
347 | \fBwinfo id \fIwindow\fR | |
348 | .VS | |
349 | Returns a hexadecimal string giving a low-level platform-specific | |
350 | identifier for \fIwindow\fR. On Unix platforms, this is the X | |
351 | window identifier. Under Windows, this is the Windows | |
352 | HWND. On the Macintosh the value has no meaning outside Tk. | |
353 | .VE | |
354 | .TP | |
355 | \fBwinfo interps \fR?\fB\-displayof \fIwindow\fR? | |
356 | Returns a list whose members are the names of all Tcl interpreters | |
357 | (e.g. all Tk-based applications) currently registered for a particular display. | |
358 | If the \fB\-displayof\fR option is given then the return value refers | |
359 | to the display of \fIwindow\fR; otherwise it refers to | |
360 | the display of the application's main window. | |
361 | .TP | |
362 | \fBwinfo ismapped \fIwindow\fR | |
363 | Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise. | |
364 | .TP | |
365 | \fBwinfo manager \fIwindow\fR | |
366 | Returns the name of the geometry manager currently | |
367 | responsible for \fIwindow\fR, or an empty string if \fIwindow\fR | |
368 | isn't managed by any geometry manager. | |
369 | The name is usually the name of the Tcl command for the geometry | |
370 | manager, such as \fBpack\fR or \fBplace\fR. | |
371 | If the geometry manager is a widget, such as canvases or text, the | |
372 | name is the widget's class command, such as \fBcanvas\fR. | |
373 | .TP | |
374 | \fBwinfo name \fIwindow\fR | |
375 | Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed | |
376 | to its full path name). | |
377 | The command \fBwinfo name .\fR will return the name of the application. | |
378 | .TP | |
379 | \fBwinfo parent \fIwindow\fR | |
380 | Returns the path name of \fIwindow\fR's parent, or an empty string | |
381 | if \fIwindow\fR is the main window of the application. | |
382 | .TP | |
383 | \fBwinfo pathname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR | |
384 | Returns the path name of the window whose X identifier is \fIid\fR. | |
385 | \fIId\fR must be a decimal, hexadecimal, or octal integer and must | |
386 | correspond to a window in the invoking application. | |
387 | If the \fB\-displayof\fR option is given then the identifier is looked | |
388 | up on the display of \fIwindow\fR; otherwise it is looked up on | |
389 | the display of the application's main window. | |
390 | .TP | |
391 | \fBwinfo pixels \fIwindow\fR \fInumber\fR | |
392 | Returns the number of pixels in \fIwindow\fR corresponding | |
393 | to the distance given by \fInumber\fR. | |
394 | \fINumber\fR may be specified in any of the forms acceptable | |
395 | to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''. | |
396 | The result is rounded to the nearest integer value; for a | |
397 | fractional result, use \fBwinfo fpixels\fR. | |
398 | .TP | |
399 | \fBwinfo pointerx \fIwindow\fR | |
400 | If the mouse pointer is on the same screen as \fIwindow\fR, returns the | |
401 | pointer's x coordinate, measured in pixels in the screen's root window. | |
402 | If a virtual root window is in use on the screen, the position is | |
403 | measured in the virtual root. | |
404 | If the mouse pointer isn't on the same screen as \fIwindow\fR then | |
405 | -1 is returned. | |
406 | .TP | |
407 | \fBwinfo pointerxy \fIwindow\fR | |
408 | If the mouse pointer is on the same screen as \fIwindow\fR, returns a list | |
409 | with two elements, which are the pointer's x and y coordinates measured | |
410 | in pixels in the screen's root window. | |
411 | If a virtual root window is in use on the screen, the position | |
412 | is computed in the virtual root. | |
413 | If the mouse pointer isn't on the same screen as \fIwindow\fR then | |
414 | both of the returned coordinates are -1. | |
415 | .TP | |
416 | \fBwinfo pointery \fIwindow\fR | |
417 | If the mouse pointer is on the same screen as \fIwindow\fR, returns the | |
418 | pointer's y coordinate, measured in pixels in the screen's root window. | |
419 | If a virtual root window is in use on the screen, the position | |
420 | is computed in the virtual root. | |
421 | If the mouse pointer isn't on the same screen as \fIwindow\fR then | |
422 | -1 is returned. | |
423 | .TP | |
424 | \fBwinfo reqheight \fIwindow\fR | |
425 | Returns a decimal string giving \fIwindow\fR's requested height, | |
426 | in pixels. This is the value used by \fIwindow\fR's geometry | |
427 | manager to compute its geometry. | |
428 | .TP | |
429 | \fBwinfo reqwidth \fIwindow\fR | |
430 | Returns a decimal string giving \fIwindow\fR's requested width, | |
431 | in pixels. This is the value used by \fIwindow\fR's geometry | |
432 | manager to compute its geometry. | |
433 | .TP | |
434 | \fBwinfo rgb \fIwindow color\fR | |
435 | Returns a list containing three decimal values in the range 0 to | |
436 | 65535, which are the | |
437 | red, green, and blue intensities that correspond to \fIcolor\fR in | |
438 | the window given by \fIwindow\fR. \fIColor\fR | |
439 | may be specified in any of the forms acceptable for a color | |
440 | option. | |
441 | .TP | |
442 | \fBwinfo rootx \fIwindow\fR | |
443 | Returns a decimal string giving the x-coordinate, in the root | |
444 | window of the screen, of the | |
445 | upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it | |
446 | has no border). | |
447 | .TP | |
448 | \fBwinfo rooty \fIwindow\fR | |
449 | Returns a decimal string giving the y-coordinate, in the root | |
450 | window of the screen, of the | |
451 | upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it | |
452 | has no border). | |
453 | .TP | |
454 | \fBwinfo screen \fIwindow\fR | |
455 | Returns the name of the screen associated with \fIwindow\fR, in | |
456 | the form \fIdisplayName\fR.\fIscreenIndex\fR. | |
457 | .TP | |
458 | \fBwinfo screencells \fIwindow\fR | |
459 | Returns a decimal string giving the number of cells in the default | |
460 | color map for \fIwindow\fR's screen. | |
461 | .TP | |
462 | \fBwinfo screendepth \fIwindow\fR | |
463 | Returns a decimal string giving the depth of the root window | |
464 | of \fIwindow\fR's screen (number of bits per pixel). | |
465 | .TP | |
466 | \fBwinfo screenheight \fIwindow\fR | |
467 | Returns a decimal string giving the height of \fIwindow\fR's screen, | |
468 | in pixels. | |
469 | .TP | |
470 | \fBwinfo screenmmheight \fIwindow\fR | |
471 | Returns a decimal string giving the height of \fIwindow\fR's screen, | |
472 | in millimeters. | |
473 | .TP | |
474 | \fBwinfo screenmmwidth \fIwindow\fR | |
475 | Returns a decimal string giving the width of \fIwindow\fR's screen, | |
476 | in millimeters. | |
477 | .TP | |
478 | \fBwinfo screenvisual \fIwindow\fR | |
479 | Returns one of the following strings to indicate the default visual | |
480 | class for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR, | |
481 | \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or | |
482 | \fBtruecolor\fR. | |
483 | .TP | |
484 | \fBwinfo screenwidth \fIwindow\fR | |
485 | Returns a decimal string giving the width of \fIwindow\fR's screen, | |
486 | in pixels. | |
487 | .TP | |
488 | \fBwinfo server \fIwindow\fR | |
489 | Returns a string containing information about the server for | |
490 | \fIwindow\fR's display. The exact format of this string may vary | |
491 | from platform to platform. For X servers the string | |
492 | has the form ``\fBX\fImajor\fBR\fIminor vendor vendorVersion\fR'' | |
493 | where \fImajor\fR and \fIminor\fR are the version and revision | |
494 | numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR | |
495 | is the name of the vendor for the server, and \fIvendorRelease\fR | |
496 | is an integer release number provided by the server. | |
497 | .TP | |
498 | \fBwinfo toplevel \fIwindow\fR | |
499 | Returns the path name of the top-level window containing \fIwindow\fR. | |
500 | .TP | |
501 | \fBwinfo viewable \fIwindow\fR | |
502 | Returns 1 if \fIwindow\fR and all of its ancestors up through the | |
503 | nearest toplevel window are mapped. Returns 0 if any of these | |
504 | windows are not mapped. | |
505 | .TP | |
506 | \fBwinfo visual \fIwindow\fR | |
507 | Returns one of the following strings to indicate the visual | |
508 | class for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR, | |
509 | \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or | |
510 | \fBtruecolor\fR. | |
511 | .TP | |
512 | \fBwinfo visualid \fIwindow\fR | |
513 | Returns the X identifier for the visual for \fIwindow\fR. | |
514 | .TP | |
515 | \fBwinfo visualsavailable \fIwindow\fR ?\fBincludeids\fR? | |
516 | Returns a list whose elements describe the visuals available for | |
517 | \fIwindow\fR's screen. | |
518 | Each element consists of a visual class followed by an integer depth. | |
519 | The class has the same form as returned by \fBwinfo visual\fR. | |
520 | The depth gives the number of bits per pixel in the visual. | |
521 | In addition, if the \fBincludeids\fR argument is provided, then the | |
522 | depth is followed by the X identifier for the visual. | |
523 | .TP | |
524 | \fBwinfo vrootheight \fIwindow\fR | |
525 | Returns the height of the virtual root window associated with \fIwindow\fR | |
526 | if there is one; otherwise returns the height of \fIwindow\fR's screen. | |
527 | .TP | |
528 | \fBwinfo vrootwidth \fIwindow\fR | |
529 | Returns the width of the virtual root window associated with \fIwindow\fR | |
530 | if there is one; otherwise returns the width of \fIwindow\fR's screen. | |
531 | .TP | |
532 | \fBwinfo vrootx \fIwindow\fR | |
533 | Returns the x-offset of the virtual root window associated with \fIwindow\fR, | |
534 | relative to the root window of its screen. | |
535 | This is normally either zero or negative. | |
536 | Returns 0 if there is no virtual root window for \fIwindow\fR. | |
537 | .TP | |
538 | \fBwinfo vrooty \fIwindow\fR | |
539 | Returns the y-offset of the virtual root window associated with \fIwindow\fR, | |
540 | relative to the root window of its screen. | |
541 | This is normally either zero or negative. | |
542 | Returns 0 if there is no virtual root window for \fIwindow\fR. | |
543 | .TP | |
544 | \fBwinfo width \fIwindow\fR | |
545 | Returns a decimal string giving \fIwindow\fR's width in pixels. | |
546 | When a window is first created its width will be 1 pixel; the | |
547 | width will eventually be changed by a geometry manager to fulfill | |
548 | the window's needs. | |
549 | If you need the true width immediately after creating a widget, | |
550 | invoke \fBupdate\fR to force the geometry manager to arrange it, | |
551 | or use \fBwinfo reqwidth\fR to get the window's requested width | |
552 | instead of its actual width. | |
553 | .TP | |
554 | \fBwinfo x \fIwindow\fR | |
555 | Returns a decimal string giving the x-coordinate, in \fIwindow\fR's | |
556 | parent, of the | |
557 | upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it | |
558 | has no border). | |
559 | .TP | |
560 | \fBwinfo y \fIwindow\fR | |
561 | Returns a decimal string giving the y-coordinate, in \fIwindow\fR's | |
562 | parent, of the | |
563 | upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it | |
564 | has no border). | |
565 | .SH EXAMPLE | |
566 | Print where the mouse pointer is and what window it is currently over: | |
567 | .CS | |
568 | set x [\fBwinfo pointerx\fR .] | |
569 | set y [\fBwinfo pointery\fR .] | |
570 | puts -nonewline "Mouse pointer at ($x,$y) which is " | |
571 | set win [\fBwinfo containing\fR $x $y] | |
572 | if {$win eq ""} { | |
573 | puts "over no window" | |
574 | } else { | |
575 | puts "over $win" | |
576 | } | |
577 | .CE | |
578 | ||
579 | .SH KEYWORDS | |
580 | atom, children, class, geometry, height, identifier, information, interpreters, | |
581 | mapped, parent, path name, screen, virtual root, width, window |