Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / man / mann / winfo.n
CommitLineData
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
219See 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
226Command-Line Name: \\fB\\$1\\fR
227Database Name: \\fB\\$2\\fR
228Database 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
250winfo \- Return window-related information
251.SH SYNOPSIS
252\fBwinfo\fR \fIoption \fR?\fIarg arg ...\fR?
253.BE
254
255.SH DESCRIPTION
256.PP
257The \fBwinfo\fR command is used to retrieve information about windows
258managed by Tk. It can take any of a number of different forms,
259depending on the \fIoption\fR argument. The legal forms are:
260.TP
261\fBwinfo atom \fR?\fB\-displayof \fIwindow\fR? \fIname\fR
262Returns a decimal string giving the integer identifier for the
263atom whose name is \fIname\fR. If no atom exists with the name
264\fIname\fR then a new one is created.
265If the \fB\-displayof\fR option is given then the atom is looked
266up on the display of \fIwindow\fR; otherwise it is looked up on
267the display of the application's main window.
268.TP
269\fBwinfo atomname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR
270Returns the textual name for the atom whose integer identifier is
271\fIid\fR.
272If the \fB\-displayof\fR option is given then the identifier is looked
273up on the display of \fIwindow\fR; otherwise it is looked up on
274the display of the application's main window.
275This command is the inverse of the \fBwinfo atom\fR command.
276It generates an error if no such atom exists.
277.TP
278\fBwinfo cells \fIwindow\fR
279Returns a decimal string giving the number of cells in the
280color map for \fIwindow\fR.
281.TP
282\fBwinfo children \fIwindow\fR
283Returns a list containing the path names of all the children
284of \fIwindow\fR. Top-level windows are returned as children
285of their logical parents. The list is in stacking order, with
286the lowest window first, except for Top-level windows which
287are not returned in stacking order. Use the \fBwm stackorder\fR
288command to query the stacking order of Top-level windows.
289.TP
290\fBwinfo class \fIwindow\fR
291Returns the class name for \fIwindow\fR.
292.TP
293\fBwinfo colormapfull \fIwindow\fR
294Returns 1 if the colormap for \fIwindow\fR is known to be full, 0
295otherwise. The colormap for a window is ``known'' to be full if the last
296attempt to allocate a new color on that window failed and this
297application hasn't freed any colors in the colormap since the
298failed allocation.
299.TP
300\fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR
301Returns the path name for the window containing the point given
302by \fIrootX\fR and \fIrootY\fR.
303\fIRootX\fR and \fIrootY\fR are specified in screen units (i.e.
304any form acceptable to \fBTk_GetPixels\fR) in the coordinate
305system of the root window (if a virtual-root window manager is in
306use then the coordinate system of the virtual root window is used).
307If the \fB\-displayof\fR option is given then the coordinates refer
308to the screen containing \fIwindow\fR; otherwise they refer to the
309screen of the application's main window.
310If no window in this application contains the point then an empty
311string is returned.
312In selecting the containing window, children are given higher priority
313than parents and among siblings the highest one in the stacking order is
314chosen.
315.TP
316\fBwinfo depth \fIwindow\fR
317Returns a decimal string giving the depth of \fIwindow\fR (number
318of bits per pixel).
319.TP
320\fBwinfo exists \fIwindow\fR
321Returns 1 if there exists a window named \fIwindow\fR, 0 if no such
322window exists.
323.TP
324\fBwinfo fpixels \fIwindow\fR \fInumber\fR
325Returns a floating-point value giving the number of pixels
326in \fIwindow\fR corresponding to the distance given by \fInumber\fR.
327\fINumber\fR may be specified in any of the forms acceptable
328to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''.
329The return value may be fractional; for an integer value, use
330\fBwinfo pixels\fR.
331.TP
332\fBwinfo geometry \fIwindow\fR
333Returns the geometry for \fIwindow\fR, in the form
334\fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR. All dimensions are
335in pixels.
336.TP
337\fBwinfo height \fIwindow\fR
338Returns a decimal string giving \fIwindow\fR's height in pixels.
339When a window is first created its height will be 1 pixel; the
340height will eventually be changed by a geometry manager to fulfill
341the window's needs.
342If you need the true height immediately after creating a widget,
343invoke \fBupdate\fR to force the geometry manager to arrange it,
344or use \fBwinfo reqheight\fR to get the window's requested height
345instead of its actual height.
346.TP
347\fBwinfo id \fIwindow\fR
348.VS
349Returns a hexadecimal string giving a low-level platform-specific
350identifier for \fIwindow\fR. On Unix platforms, this is the X
351window identifier. Under Windows, this is the Windows
352HWND. On the Macintosh the value has no meaning outside Tk.
353.VE
354.TP
355\fBwinfo interps \fR?\fB\-displayof \fIwindow\fR?
356Returns a list whose members are the names of all Tcl interpreters
357(e.g. all Tk-based applications) currently registered for a particular display.
358If the \fB\-displayof\fR option is given then the return value refers
359to the display of \fIwindow\fR; otherwise it refers to
360the display of the application's main window.
361.TP
362\fBwinfo ismapped \fIwindow\fR
363Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise.
364.TP
365\fBwinfo manager \fIwindow\fR
366Returns the name of the geometry manager currently
367responsible for \fIwindow\fR, or an empty string if \fIwindow\fR
368isn't managed by any geometry manager.
369The name is usually the name of the Tcl command for the geometry
370manager, such as \fBpack\fR or \fBplace\fR.
371If the geometry manager is a widget, such as canvases or text, the
372name is the widget's class command, such as \fBcanvas\fR.
373.TP
374\fBwinfo name \fIwindow\fR
375Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed
376to its full path name).
377The command \fBwinfo name .\fR will return the name of the application.
378.TP
379\fBwinfo parent \fIwindow\fR
380Returns the path name of \fIwindow\fR's parent, or an empty string
381if \fIwindow\fR is the main window of the application.
382.TP
383\fBwinfo pathname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR
384Returns 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
386correspond to a window in the invoking application.
387If the \fB\-displayof\fR option is given then the identifier is looked
388up on the display of \fIwindow\fR; otherwise it is looked up on
389the display of the application's main window.
390.TP
391\fBwinfo pixels \fIwindow\fR \fInumber\fR
392Returns the number of pixels in \fIwindow\fR corresponding
393to the distance given by \fInumber\fR.
394\fINumber\fR may be specified in any of the forms acceptable
395to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''.
396The result is rounded to the nearest integer value; for a
397fractional result, use \fBwinfo fpixels\fR.
398.TP
399\fBwinfo pointerx \fIwindow\fR
400If the mouse pointer is on the same screen as \fIwindow\fR, returns the
401pointer's x coordinate, measured in pixels in the screen's root window.
402If a virtual root window is in use on the screen, the position is
403measured in the virtual root.
404If the mouse pointer isn't on the same screen as \fIwindow\fR then
405-1 is returned.
406.TP
407\fBwinfo pointerxy \fIwindow\fR
408If the mouse pointer is on the same screen as \fIwindow\fR, returns a list
409with two elements, which are the pointer's x and y coordinates measured
410in pixels in the screen's root window.
411If a virtual root window is in use on the screen, the position
412is computed in the virtual root.
413If the mouse pointer isn't on the same screen as \fIwindow\fR then
414both of the returned coordinates are -1.
415.TP
416\fBwinfo pointery \fIwindow\fR
417If the mouse pointer is on the same screen as \fIwindow\fR, returns the
418pointer's y coordinate, measured in pixels in the screen's root window.
419If a virtual root window is in use on the screen, the position
420is computed in the virtual root.
421If the mouse pointer isn't on the same screen as \fIwindow\fR then
422-1 is returned.
423.TP
424\fBwinfo reqheight \fIwindow\fR
425Returns a decimal string giving \fIwindow\fR's requested height,
426in pixels. This is the value used by \fIwindow\fR's geometry
427manager to compute its geometry.
428.TP
429\fBwinfo reqwidth \fIwindow\fR
430Returns a decimal string giving \fIwindow\fR's requested width,
431in pixels. This is the value used by \fIwindow\fR's geometry
432manager to compute its geometry.
433.TP
434\fBwinfo rgb \fIwindow color\fR
435Returns a list containing three decimal values in the range 0 to
43665535, which are the
437red, green, and blue intensities that correspond to \fIcolor\fR in
438the window given by \fIwindow\fR. \fIColor\fR
439may be specified in any of the forms acceptable for a color
440option.
441.TP
442\fBwinfo rootx \fIwindow\fR
443Returns a decimal string giving the x-coordinate, in the root
444window of the screen, of the
445upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
446has no border).
447.TP
448\fBwinfo rooty \fIwindow\fR
449Returns a decimal string giving the y-coordinate, in the root
450window of the screen, of the
451upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
452has no border).
453.TP
454\fBwinfo screen \fIwindow\fR
455Returns the name of the screen associated with \fIwindow\fR, in
456the form \fIdisplayName\fR.\fIscreenIndex\fR.
457.TP
458\fBwinfo screencells \fIwindow\fR
459Returns a decimal string giving the number of cells in the default
460color map for \fIwindow\fR's screen.
461.TP
462\fBwinfo screendepth \fIwindow\fR
463Returns a decimal string giving the depth of the root window
464of \fIwindow\fR's screen (number of bits per pixel).
465.TP
466\fBwinfo screenheight \fIwindow\fR
467Returns a decimal string giving the height of \fIwindow\fR's screen,
468in pixels.
469.TP
470\fBwinfo screenmmheight \fIwindow\fR
471Returns a decimal string giving the height of \fIwindow\fR's screen,
472in millimeters.
473.TP
474\fBwinfo screenmmwidth \fIwindow\fR
475Returns a decimal string giving the width of \fIwindow\fR's screen,
476in millimeters.
477.TP
478\fBwinfo screenvisual \fIwindow\fR
479Returns one of the following strings to indicate the default visual
480class 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
485Returns a decimal string giving the width of \fIwindow\fR's screen,
486in pixels.
487.TP
488\fBwinfo server \fIwindow\fR
489Returns a string containing information about the server for
490\fIwindow\fR's display. The exact format of this string may vary
491from platform to platform. For X servers the string
492has the form ``\fBX\fImajor\fBR\fIminor vendor vendorVersion\fR''
493where \fImajor\fR and \fIminor\fR are the version and revision
494numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR
495is the name of the vendor for the server, and \fIvendorRelease\fR
496is an integer release number provided by the server.
497.TP
498\fBwinfo toplevel \fIwindow\fR
499Returns the path name of the top-level window containing \fIwindow\fR.
500.TP
501\fBwinfo viewable \fIwindow\fR
502Returns 1 if \fIwindow\fR and all of its ancestors up through the
503nearest toplevel window are mapped. Returns 0 if any of these
504windows are not mapped.
505.TP
506\fBwinfo visual \fIwindow\fR
507Returns one of the following strings to indicate the visual
508class 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
513Returns the X identifier for the visual for \fIwindow\fR.
514.TP
515\fBwinfo visualsavailable \fIwindow\fR ?\fBincludeids\fR?
516Returns a list whose elements describe the visuals available for
517\fIwindow\fR's screen.
518Each element consists of a visual class followed by an integer depth.
519The class has the same form as returned by \fBwinfo visual\fR.
520The depth gives the number of bits per pixel in the visual.
521In addition, if the \fBincludeids\fR argument is provided, then the
522depth is followed by the X identifier for the visual.
523.TP
524\fBwinfo vrootheight \fIwindow\fR
525Returns the height of the virtual root window associated with \fIwindow\fR
526if there is one; otherwise returns the height of \fIwindow\fR's screen.
527.TP
528\fBwinfo vrootwidth \fIwindow\fR
529Returns the width of the virtual root window associated with \fIwindow\fR
530if there is one; otherwise returns the width of \fIwindow\fR's screen.
531.TP
532\fBwinfo vrootx \fIwindow\fR
533Returns the x-offset of the virtual root window associated with \fIwindow\fR,
534relative to the root window of its screen.
535This is normally either zero or negative.
536Returns 0 if there is no virtual root window for \fIwindow\fR.
537.TP
538\fBwinfo vrooty \fIwindow\fR
539Returns the y-offset of the virtual root window associated with \fIwindow\fR,
540relative to the root window of its screen.
541This is normally either zero or negative.
542Returns 0 if there is no virtual root window for \fIwindow\fR.
543.TP
544\fBwinfo width \fIwindow\fR
545Returns a decimal string giving \fIwindow\fR's width in pixels.
546When a window is first created its width will be 1 pixel; the
547width will eventually be changed by a geometry manager to fulfill
548the window's needs.
549If you need the true width immediately after creating a widget,
550invoke \fBupdate\fR to force the geometry manager to arrange it,
551or use \fBwinfo reqwidth\fR to get the window's requested width
552instead of its actual width.
553.TP
554\fBwinfo x \fIwindow\fR
555Returns a decimal string giving the x-coordinate, in \fIwindow\fR's
556parent, of the
557upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
558has no border).
559.TP
560\fBwinfo y \fIwindow\fR
561Returns a decimal string giving the y-coordinate, in \fIwindow\fR's
562parent, of the
563upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
564has no border).
565.SH EXAMPLE
566Print where the mouse pointer is and what window it is currently over:
567.CS
568set x [\fBwinfo pointerx\fR .]
569set y [\fBwinfo pointery\fR .]
570puts -nonewline "Mouse pointer at ($x,$y) which is "
571set win [\fBwinfo containing\fR $x $y]
572if {$win eq ""} {
573 puts "over no window"
574} else {
575 puts "over $win"
576}
577.CE
578
579.SH KEYWORDS
580atom, children, class, geometry, height, identifier, information, interpreters,
581mapped, parent, path name, screen, virtual root, width, window