home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / winfo.n < prev    next >
Encoding:
Text File  |  1993-07-09  |  9.9 KB  |  268 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/winfo.n,v 1.24 93/07/09 09:56:06 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS winfo tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. winfo \- Return window-related information
  29. .SH SYNOPSIS
  30. \fBwinfo\fR \fIoption \fR?\fIarg arg ...\fR?
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. The \fBwinfo\fR command is used to retrieve information about windows
  36. managed by Tk.  It can take any of a number of different forms,
  37. depending on the \fIoption\fR argument.  The legal forms are:
  38. .TP
  39. \fBwinfo atom \fIname\fR
  40. .VS
  41. Returns a decimal string giving the integer identifier for the
  42. atom whose name is \fIname\fR.  If no atom exists with the name
  43. \fIname\fR then a new one is created.
  44. .TP
  45. \fBwinfo atomname \fIid\fR
  46. Returns the textual name for the atom whose integer identifier is
  47. \fIid\fR.
  48. This command is the inverse of the \fBwinfo atom\fR command.
  49. Generates an error if no such atom exists.
  50. .TP
  51. \fBwinfo cells \fIwindow\fR
  52. Returns a decimal string giving the number of cells in the
  53. color map for \fIwindow\fR.
  54. .VE
  55. .TP
  56. \fBwinfo children \fIwindow\fR
  57. Returns a list containing the path names of all the children
  58. of \fIwindow\fR.  Top-level windows are returned as children
  59. of their logical parents.
  60. .TP
  61. \fBwinfo class \fIwindow\fR
  62. Returns the class name for \fIwindow\fR.
  63. .TP
  64. \fBwinfo containing \fIrootX rootY\fR
  65. .VS
  66. Returns the path name for the window containing the point given
  67. by \fIrootX\fR and \fIrootY\fR.
  68. \fIRootX\fR and \fIrootY\fR are specified in screen units (i.e.
  69. any form acceptable to \fBTk_GetPixels\fR) in the coordinate
  70. system of the root window (if a virtual-root window manager is in
  71. use then the coordinate system of the virtual root window is used).
  72. If no window in this application contains the point then an empty
  73. string is returned.
  74. In selecting the containing window, children are given higher priority
  75. than parents and among siblings the highest one in the stacking order is
  76. chosen.
  77. .TP
  78. \fBwinfo depth \fIwindow\fR
  79. Returns a decimal string giving the depth of \fIwindow\fR (number
  80. of bits per pixel).
  81. .TP
  82. \fBwinfo exists \fIwindow\fR
  83. Returns 1 if there exists a window named \fIwindow\fR, 0 if no such
  84. window exists.
  85. .TP
  86. \fBwinfo fpixels \fIwindow\fR \fInumber\fR
  87. Returns a floating-point value giving the number of pixels
  88. in \fIwindow\fR corresponding to the distance given by \fInumber\fR.
  89. \fINumber\fR may be specified in any of the forms acceptable
  90. to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''.
  91. The return value may be fractional;  for an integer value, use
  92. \fBwinfo pixels\fR.
  93. .VE
  94. .TP
  95. \fBwinfo geometry \fIwindow\fR
  96. Returns the geometry for \fIwindow\fR, in the form
  97. \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR.  All dimensions are
  98. in pixels.
  99. .TP
  100. \fBwinfo height \fIwindow\fR
  101. Returns a decimal string giving \fIwindow\fR's height in pixels.
  102. When a window is first created its height will be 1 pixel;  the
  103. height will eventually be changed by a geometry manager to fulfill
  104. the window's needs.
  105. If you need the true height immediately after creating a widget,
  106. invoke \fBupdate\fR to force the geometry manager to arrange it,
  107. or use \fBwinfo reqheight\fR to get the window's requested height
  108. instead of its actual height.
  109. .TP
  110. \fBwinfo id \fIwindow\fR
  111. Returns a hexadecimal string indicating the X identifier for \fIwindow\fR.
  112. .TP
  113. \fBwinfo interps\fR
  114. Returns a list whose members are the names of all Tcl interpreters
  115. (e.g. all Tk-based applications) currently registered for the
  116. display of the invoking application.
  117. .TP
  118. \fBwinfo ismapped \fIwindow\fR
  119. Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise.
  120. .TP
  121. \fBwinfo name \fIwindow\fR
  122. Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed
  123. to its full path name).
  124. .VS
  125. The command \fBwinfo name .\fR will return the name of the application.
  126. .VE
  127. .TP
  128. \fBwinfo parent \fIwindow\fR
  129. Returns the path name of \fIwindow\fR's parent, or an empty string
  130. if \fIwindow\fR is the main window of the application.
  131. .TP
  132. \fBwinfo pathname \fIid\fR
  133. Returns the path name of the window whose X identifier is \fIid\fR.
  134. \fIId\fR must be a decimal, hexadecimal, or octal integer and must
  135. correspond to a window in the invoking application.
  136. .TP
  137. \fBwinfo pixels \fIwindow\fR \fInumber\fR
  138. .VS
  139. Returns the number of pixels in \fIwindow\fR corresponding
  140. to the distance given by \fInumber\fR.
  141. \fINumber\fR may be specified in any of the forms acceptable
  142. to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''.
  143. The result is rounded to the nearest integer value;  for a
  144. fractional result, use \fBwinfo fpixels\fR.
  145. .VE
  146. .TP
  147. \fBwinfo reqheight \fIwindow\fR
  148. Returns a decimal string giving \fIwindow\fR's requested height,
  149. in pixels.  This is the value used by \fIwindow\fR's geometry
  150. manager to compute its geometry.
  151. .TP
  152. \fBwinfo reqwidth \fIwindow\fR
  153. Returns a decimal string giving \fIwindow\fR's requested width,
  154. in pixels.  This is the value used by \fIwindow\fR's geometry
  155. manager to compute its geometry.
  156. .TP
  157. \fBwinfo rgb \fIwindow color\fR
  158. .VS
  159. Returns a list containing three decimal values, which are the
  160. red, green, and blue intensities that correspond to \fIcolor\fR in
  161. the window given by \fIwindow\fR.  \fIColor\fR
  162. may be specified in any of the forms acceptable for a color
  163. option.
  164. .VE
  165. .TP
  166. \fBwinfo rootx \fIwindow\fR
  167. Returns a decimal string giving the x-coordinate, in the root
  168. window of the screen, of the
  169. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  170. has no border).
  171. .TP
  172. \fBwinfo rooty \fIwindow\fR
  173. Returns a decimal string giving the y-coordinate, in the root
  174. window of the screen, of the
  175. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  176. has no border).
  177. .TP
  178. \fBwinfo screen \fIwindow\fR
  179. Returns the name of the screen associated with \fIwindow\fR, in
  180. the form \fIdisplayName\fR.\fIscreenIndex\fR.
  181. .TP
  182. \fBwinfo screencells \fIwindow\fR
  183. .VS
  184. Returns a decimal string giving the number of cells in the default
  185. color map for \fIwindow\fR's screen.
  186. .TP
  187. \fBwinfo screendepth \fIwindow\fR
  188. Returns a decimal string giving the depth of the root window
  189. of \fIwindow\fR's screen (number of bits per pixel).
  190. .TP
  191. \fBwinfo screenheight \fIwindow\fR
  192. Returns a decimal string giving the height of \fIwindow\fR's screen,
  193. in pixels.
  194. .TP
  195. \fBwinfo screenmmheight \fIwindow\fR
  196. Returns a decimal string giving the height of \fIwindow\fR's screen,
  197. in millimeters.
  198. .TP
  199. \fBwinfo screenmmwidth \fIwindow\fR
  200. Returns a decimal string giving the width of \fIwindow\fR's screen,
  201. in millimeters.
  202. .TP
  203. \fBwinfo screenvisual \fIwindow\fR
  204. Returns one of the following strings to indicate the default visual
  205. type for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR,
  206. \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
  207. \fBtruecolor\fR.
  208. .TP
  209. \fBwinfo screenwidth \fIwindow\fR
  210. Returns a decimal string giving the width of \fIwindow\fR's screen,
  211. in pixels.
  212. .TP
  213. \fBwinfo toplevel \fIwindow\fR
  214. Returns the path name of the top-level window containing \fIwindow\fR.
  215. .TP
  216. \fBwinfo visual \fIwindow\fR
  217. Returns one of the following strings to indicate the visual
  218. type for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR,
  219. \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
  220. \fBtruecolor\fR.
  221. .TP
  222. \fBwinfo vrootheight \fIwindow\fR
  223. Returns the height of the virtual root window associated with \fIwindow\fR
  224. if there is one;  otherwise returns the height of \fIwindow\fR's screen.
  225. .TP
  226. \fBwinfo vrootwidth \fIwindow\fR
  227. Returns the width of the virtual root window associated with \fIwindow\fR
  228. if there is one;  otherwise returns the width of \fIwindow\fR's screen.
  229. .TP
  230. \fBwinfo vrootx \fIwindow\fR
  231. Returns the x-offset of the virtual root window associated with \fIwindow\fR,
  232. relative to the root window of its screen.
  233. This is normally either zero or negative.
  234. Returns 0 if there is no virtual root window for \fIwindow\fR.
  235. .TP
  236. \fBwinfo vrooty \fIwindow\fR
  237. Returns the y-offset of the virtual root window associated with \fIwindow\fR,
  238. relative to the root window of its screen.
  239. This is normally either zero or negative.
  240. Returns 0 if there is no virtual root window for \fIwindow\fR.
  241. .VE
  242. .TP
  243. \fBwinfo width \fIwindow\fR
  244. Returns a decimal string giving \fIwindow\fR's width in pixels.
  245. When a window is first created its width will be 1 pixel;  the
  246. width will eventually be changed by a geometry manager to fulfill
  247. the window's needs.
  248. If you need the true width immediately after creating a widget,
  249. invoke \fBupdate\fR to force the geometry manager to arrange it,
  250. or use \fBwinfo reqwidth\fR to get the window's requested width
  251. instead of its actual width.
  252. .TP
  253. \fBwinfo x \fIwindow\fR
  254. Returns a decimal string giving the x-coordinate, in \fIwindow\fR's
  255. parent, of the
  256. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  257. has no border).
  258. .TP
  259. \fBwinfo y \fIwindow\fR
  260. Returns a decimal string giving the y-coordinate, in \fIwindow\fR's
  261. parent, of the
  262. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  263. has no border).
  264.  
  265. .SH KEYWORDS
  266. atom, children, class, geometry, height, identifier, information, interpreters,
  267. mapped, parent, path name, screen, virtual root, width, window
  268.