| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>winfo (GCL TK Manual)</title> |
| 7 |
|
| 8 |
<meta name="description" content="winfo (GCL TK Manual)"> |
| 9 |
<meta name="keywords" content="winfo (GCL TK Manual)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="wm.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| 15 |
<link href="Control.html" rel="up" title="Control"> |
| 16 |
<link href="wm.html" rel="next" title="wm"> |
| 17 |
<link href="update.html" rel="prev" title="update"> |
| 18 |
<style type="text/css"> |
| 19 |
<!-- |
| 20 |
a.summary-letter {text-decoration: none} |
| 21 |
blockquote.indentedblock {margin-right: 0em} |
| 22 |
div.display {margin-left: 3.2em} |
| 23 |
div.example {margin-left: 3.2em} |
| 24 |
div.lisp {margin-left: 3.2em} |
| 25 |
kbd {font-style: oblique} |
| 26 |
pre.display {font-family: inherit} |
| 27 |
pre.format {font-family: inherit} |
| 28 |
pre.menu-comment {font-family: serif} |
| 29 |
pre.menu-preformatted {font-family: serif} |
| 30 |
span.nolinebreak {white-space: nowrap} |
| 31 |
span.roman {font-family: initial; font-weight: normal} |
| 32 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 33 |
ul.no-bullet {list-style: none} |
| 34 |
--> |
| 35 |
</style> |
| 36 |
|
| 37 |
|
| 38 |
</head> |
| 39 |
|
| 40 |
<body lang="en"> |
| 41 |
<span id="winfo"></span><div class="header"> |
| 42 |
<p> |
| 43 |
Next: <a href="wm.html" accesskey="n" rel="next">wm</a>, Previous: <a href="update.html" accesskey="p" rel="prev">update</a>, Up: <a href="Control.html" accesskey="u" rel="up">Control</a> [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> |
| 44 |
</div> |
| 45 |
<hr> |
| 46 |
<span id="winfo-1"></span><h3 class="section">3.24 winfo</h3> |
| 47 |
|
| 48 |
<p>winfo \- Return window-related information |
| 49 |
</p><span id="Synopsis-36"></span><h4 class="unnumberedsubsec">Synopsis</h4> |
| 50 |
<p><b>winfo</b><span class="roman"> </span><i>option </i><span class="roman">?</span><i>arg arg ...</i>? |
| 51 |
</p> |
| 52 |
<span id="Description-35"></span><h4 class="unnumberedsubsec">Description</h4> |
| 53 |
|
| 54 |
<p>The <b>winfo</b> command is used to retrieve information about windows |
| 55 |
managed by Tk. It can take any of a number of different forms, |
| 56 |
depending on the <i>option</i> argument. The legal forms are: |
| 57 |
</p> |
| 58 |
<dl compact="compact"> |
| 59 |
<dt><b>winfo :atom </b><i>name</i></dt> |
| 60 |
<dd><p>Returns a decimal string giving the integer identifier for the |
| 61 |
atom whose name is <i>name</i>. If no atom exists with the name |
| 62 |
<i>name</i> then a new one is created. |
| 63 |
</p></dd> |
| 64 |
<dt><b>winfo :atomname </b><i>id</i></dt> |
| 65 |
<dd><p>Returns the textual name for the atom whose integer identifier is |
| 66 |
<i>id</i>. |
| 67 |
This command is the inverse of the <b>winfo :atom</b> command. |
| 68 |
Generates an error if no such atom exists. |
| 69 |
</p></dd> |
| 70 |
<dt><b>winfo :cells </b><i>window</i></dt> |
| 71 |
<dd><p>Returns a decimal string giving the number of cells in the |
| 72 |
color map for <i>window</i>. |
| 73 |
</p></dd> |
| 74 |
<dt><b>winfo :children </b><i>window</i></dt> |
| 75 |
<dd><p>Returns a list containing the path names of all the children |
| 76 |
of <i>window</i>. Top-level windows are returned as children |
| 77 |
of their logical parents. |
| 78 |
</p></dd> |
| 79 |
<dt><b>winfo :class </b><i>window</i></dt> |
| 80 |
<dd><p>Returns the class name for <i>window</i>. |
| 81 |
</p></dd> |
| 82 |
<dt><b>winfo :containing </b><i>rootX rootY</i></dt> |
| 83 |
<dd><p>Returns the path name for the window containing the point given |
| 84 |
by <i>rootX</i><span class="roman"> and </span><i>rootY</i>. |
| 85 |
<i>RootX</i><span class="roman"> and </span><i>rootY</i> are specified in screen units (i.e. |
| 86 |
any form acceptable to <b>Tk_GetPixels</b>) in the coordinate |
| 87 |
system of the root window (if a virtual-root window manager is in |
| 88 |
use then the coordinate system of the virtual root window is used). |
| 89 |
If no window in this application contains the point then an empty |
| 90 |
string is returned. |
| 91 |
In selecting the containing window, children are given higher priority |
| 92 |
than parents and among siblings the highest one in the stacking order is |
| 93 |
chosen. |
| 94 |
</p></dd> |
| 95 |
<dt><b>winfo :depth </b><i>window</i></dt> |
| 96 |
<dd><p>Returns a decimal string giving the depth of <i>window</i> (number |
| 97 |
of bits per pixel). |
| 98 |
</p></dd> |
| 99 |
<dt><b>winfo :exists </b><i>window</i></dt> |
| 100 |
<dd><p>Returns 1 if there exists a window named <i>window</i>, 0 if no such |
| 101 |
window exists. |
| 102 |
</p></dd> |
| 103 |
<dt><b>winfo :fpixels </b><i>window</i><span class="roman"> </span><i>number</i></dt> |
| 104 |
<dd><p>Returns a floating-point value giving the number of pixels |
| 105 |
in <i>window</i><span class="roman"> corresponding to the distance given by </span><i>number</i>. |
| 106 |
<i>Number</i> may be specified in any of the forms acceptable |
| 107 |
to <b>Tk_GetScreenMM</b>, such as “2.0c” or “1i”. |
| 108 |
The return value may be fractional; for an integer value, use |
| 109 |
<b>winfo :pixels</b>. |
| 110 |
</p></dd> |
| 111 |
<dt><b>winfo :geometry </b><i>window</i></dt> |
| 112 |
<dd><p>Returns the geometry for <i>window</i>, in the form |
| 113 |
<i>width</i><b>x</b><i>height</i><b>+</b><i>x</i><b>+</b><i>y</i>. All dimensions are |
| 114 |
in pixels. |
| 115 |
</p></dd> |
| 116 |
<dt><b>winfo :height </b><i>window</i></dt> |
| 117 |
<dd><p>Returns a decimal string giving <i>window</i>’s height in pixels. |
| 118 |
When a window is first created its height will be 1 pixel; the |
| 119 |
height will eventually be changed by a geometry manager to fulfill |
| 120 |
the window’s needs. |
| 121 |
If you need the true height immediately after creating a widget, |
| 122 |
invoke <b>update</b> to force the geometry manager to arrange it, |
| 123 |
or use <b>winfo :reqheight</b> to get the window’s requested height |
| 124 |
instead of its actual height. |
| 125 |
</p></dd> |
| 126 |
<dt><b>winfo :id </b><i>window</i></dt> |
| 127 |
<dd><p>Returns a hexadecimal string indicating the X identifier for <i>window</i>. |
| 128 |
</p></dd> |
| 129 |
<dt><b>winfo :interps</b></dt> |
| 130 |
<dd><p>Returns a list whose members are the names of all Tcl interpreters |
| 131 |
(e.g. all Tk-based applications) currently registered for the |
| 132 |
display of the invoking application. |
| 133 |
</p></dd> |
| 134 |
<dt><b>winfo :ismapped </b><i>window</i></dt> |
| 135 |
<dd><p>Returns <b>1</b><span class="roman"> if </span><i>window</i><span class="roman"> is currently mapped, </span><b>0</b> otherwise. |
| 136 |
</p></dd> |
| 137 |
<dt><b>winfo :name </b><i>window</i></dt> |
| 138 |
<dd><p>Returns <i>window</i>’s name (i.e. its name within its parent, as opposed |
| 139 |
to its full path name). |
| 140 |
The command <b>winfo :name .</b> will return the name of the application. |
| 141 |
</p></dd> |
| 142 |
<dt><b>winfo :parent </b><i>window</i></dt> |
| 143 |
<dd><p>Returns the path name of <i>window</i>’s parent, or an empty string |
| 144 |
if <i>window</i> is the main window of the application. |
| 145 |
</p></dd> |
| 146 |
<dt><b>winfo :pathname </b><i>id</i></dt> |
| 147 |
<dd><p>Returns the path name of the window whose X identifier is <i>id</i>. |
| 148 |
<i>Id</i> must be a decimal, hexadecimal, or octal integer and must |
| 149 |
correspond to a window in the invoking application. |
| 150 |
</p></dd> |
| 151 |
<dt><b>winfo :pixels </b><i>window</i><span class="roman"> </span><i>number</i></dt> |
| 152 |
<dd><p>Returns the number of pixels in <i>window</i> corresponding |
| 153 |
to the distance given by <i>number</i>. |
| 154 |
<i>Number</i> may be specified in any of the forms acceptable |
| 155 |
to <b>Tk_GetPixels</b>, such as “2.0c” or “1i”. |
| 156 |
The result is rounded to the nearest integer value; for a |
| 157 |
fractional result, use <b>winfo :fpixels</b>. |
| 158 |
</p></dd> |
| 159 |
<dt><b>winfo :reqheight </b><i>window</i></dt> |
| 160 |
<dd><p>Returns a decimal string giving <i>window</i>’s requested height, |
| 161 |
in pixels. This is the value used by <i>window</i>’s geometry |
| 162 |
manager to compute its geometry. |
| 163 |
</p></dd> |
| 164 |
<dt><b>winfo :reqwidth </b><i>window</i></dt> |
| 165 |
<dd><p>Returns a decimal string giving <i>window</i>’s requested width, |
| 166 |
in pixels. This is the value used by <i>window</i>’s geometry |
| 167 |
manager to compute its geometry. |
| 168 |
</p></dd> |
| 169 |
<dt><b>winfo :rgb </b><i>window color</i></dt> |
| 170 |
<dd><p>Returns a list containing three decimal values, which are the |
| 171 |
red, green, and blue intensities that correspond to <i>color</i> in |
| 172 |
the window given by <i>window</i><span class="roman">. </span><i>Color</i> |
| 173 |
may be specified in any of the forms acceptable for a color |
| 174 |
option. |
| 175 |
</p></dd> |
| 176 |
<dt><b>winfo :rootx </b><i>window</i></dt> |
| 177 |
<dd><p>Returns a decimal string giving the x-coordinate, in the root |
| 178 |
window of the screen, of the |
| 179 |
upper-left corner of <i>window</i><span class="roman">’s border (or </span><i>window</i> if it |
| 180 |
has no border). |
| 181 |
</p></dd> |
| 182 |
<dt><b>winfo :rooty </b><i>window</i></dt> |
| 183 |
<dd><p>Returns a decimal string giving the y-coordinate, in the root |
| 184 |
window of the screen, of the |
| 185 |
upper-left corner of <i>window</i><span class="roman">’s border (or </span><i>window</i> if it |
| 186 |
has no border). |
| 187 |
</p></dd> |
| 188 |
<dt><b>winfo :screen </b><i>window</i></dt> |
| 189 |
<dd><p>Returns the name of the screen associated with <i>window</i>, in |
| 190 |
the form <i>displayName</i><span class="roman">.</span><i>screenIndex</i>. |
| 191 |
</p></dd> |
| 192 |
<dt><b>winfo :screencells </b><i>window</i></dt> |
| 193 |
<dd><p>Returns a decimal string giving the number of cells in the default |
| 194 |
color map for <i>window</i>’s screen. |
| 195 |
</p></dd> |
| 196 |
<dt><b>winfo :screendepth </b><i>window</i></dt> |
| 197 |
<dd><p>Returns a decimal string giving the depth of the root window |
| 198 |
of <i>window</i>’s screen (number of bits per pixel). |
| 199 |
</p></dd> |
| 200 |
<dt><b>winfo :screenheight </b><i>window</i></dt> |
| 201 |
<dd><p>Returns a decimal string giving the height of <i>window</i>’s screen, |
| 202 |
in pixels. |
| 203 |
</p></dd> |
| 204 |
<dt><b>winfo :screenmmheight </b><i>window</i></dt> |
| 205 |
<dd><p>Returns a decimal string giving the height of <i>window</i>’s screen, |
| 206 |
in millimeters. |
| 207 |
</p></dd> |
| 208 |
<dt><b>winfo :screenmmwidth </b><i>window</i></dt> |
| 209 |
<dd><p>Returns a decimal string giving the width of <i>window</i>’s screen, |
| 210 |
in millimeters. |
| 211 |
</p></dd> |
| 212 |
<dt><b>winfo :screenvisual </b><i>window</i></dt> |
| 213 |
<dd><p>Returns one of the following strings to indicate the default visual |
| 214 |
type for <i>window</i><span class="roman">’s screen: </span><b>directcolor</b><span class="roman">, </span><b>grayscale</b>, |
| 215 |
<b>pseudocolor</b><span class="roman">, </span><b>staticcolor</b><span class="roman">, </span><b>staticgray</b>, or |
| 216 |
<b>truecolor</b>. |
| 217 |
</p></dd> |
| 218 |
<dt><b>winfo :screenwidth </b><i>window</i></dt> |
| 219 |
<dd><p>Returns a decimal string giving the width of <i>window</i>’s screen, |
| 220 |
in pixels. |
| 221 |
</p></dd> |
| 222 |
<dt><b>winfo :toplevel </b><i>window</i></dt> |
| 223 |
<dd><p>Returns the path name of the top-level window containing <i>window</i>. |
| 224 |
</p></dd> |
| 225 |
<dt><b>winfo :visual </b><i>window</i></dt> |
| 226 |
<dd><p>Returns one of the following strings to indicate the visual |
| 227 |
type for <i>window</i><span class="roman">: </span><b>directcolor</b><span class="roman">, </span><b>grayscale</b>, |
| 228 |
<b>pseudocolor</b><span class="roman">, </span><b>staticcolor</b><span class="roman">, </span><b>staticgray</b>, or |
| 229 |
<b>truecolor</b>. |
| 230 |
</p></dd> |
| 231 |
<dt><b>winfo :vrootheight </b><i>window</i></dt> |
| 232 |
<dd><p>Returns the height of the virtual root window associated with <i>window</i> |
| 233 |
if there is one; otherwise returns the height of <i>window</i>’s screen. |
| 234 |
</p></dd> |
| 235 |
<dt><b>winfo :vrootwidth </b><i>window</i></dt> |
| 236 |
<dd><p>Returns the width of the virtual root window associated with <i>window</i> |
| 237 |
if there is one; otherwise returns the width of <i>window</i>’s screen. |
| 238 |
</p></dd> |
| 239 |
<dt><b>winfo :vrootx </b><i>window</i></dt> |
| 240 |
<dd><p>Returns the x-offset of the virtual root window associated with <i>window</i>, |
| 241 |
relative to the root window of its screen. |
| 242 |
This is normally either zero or negative. |
| 243 |
Returns 0 if there is no virtual root window for <i>window</i>. |
| 244 |
</p></dd> |
| 245 |
<dt><b>winfo :vrooty </b><i>window</i></dt> |
| 246 |
<dd><p>Returns the y-offset of the virtual root window associated with <i>window</i>, |
| 247 |
relative to the root window of its screen. |
| 248 |
This is normally either zero or negative. |
| 249 |
Returns 0 if there is no virtual root window for <i>window</i>. |
| 250 |
</p></dd> |
| 251 |
<dt><b>winfo :width </b><i>window</i></dt> |
| 252 |
<dd><p>Returns a decimal string giving <i>window</i>’s width in pixels. |
| 253 |
When a window is first created its width will be 1 pixel; the |
| 254 |
width will eventually be changed by a geometry manager to fulfill |
| 255 |
the window’s needs. |
| 256 |
If you need the true width immediately after creating a widget, |
| 257 |
invoke <b>update</b> to force the geometry manager to arrange it, |
| 258 |
or use <b>winfo :reqwidth</b> to get the window’s requested width |
| 259 |
instead of its actual width. |
| 260 |
</p></dd> |
| 261 |
<dt><b>winfo :x </b><i>window</i></dt> |
| 262 |
<dd><p>Returns a decimal string giving the x-coordinate, in <i>window</i>’s |
| 263 |
parent, of the |
| 264 |
upper-left corner of <i>window</i><span class="roman">’s border (or </span><i>window</i> if it |
| 265 |
has no border). |
| 266 |
</p></dd> |
| 267 |
<dt><b>winfo :y </b><i>window</i></dt> |
| 268 |
<dd><p>Returns a decimal string giving the y-coordinate, in <i>window</i>’s |
| 269 |
parent, of the |
| 270 |
upper-left corner of <i>window</i><span class="roman">’s border (or </span><i>window</i> if it |
| 271 |
has no border). |
| 272 |
</p> |
| 273 |
</dd> |
| 274 |
</dl> |
| 275 |
<span id="Keywords-38"></span><h4 class="unnumberedsubsec">Keywords</h4> |
| 276 |
<p>atom, children, class, geometry, height, identifier, information, interpreters, |
| 277 |
mapped, parent, path name, screen, virtual root, width, window |
| 278 |
</p><hr> |
| 279 |
<div class="header"> |
| 280 |
<p> |
| 281 |
Next: <a href="wm.html" accesskey="n" rel="next">wm</a>, Previous: <a href="update.html" accesskey="p" rel="prev">update</a>, Up: <a href="Control.html" accesskey="u" rel="up">Control</a> [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> |
| 282 |
</div> |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
</body> |
| 287 |
</html> |