home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / wm.n < prev    next >
Encoding:
Text File  |  1993-04-15  |  26.4 KB  |  534 lines

  1. '\"
  2. '\" Copyright (c) 1991 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/wm.n,v 1.17 93/04/15 08:25:22 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS wm tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. wm \- Communicate with window manager
  29. .SH SYNOPSIS
  30. \fBwm\fR \fIoption window \fR?\fIargs\fR?
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. The \fBwm\fR command is used to interact with window managers in
  36. order to control such things as the title for a window, its geometry,
  37. or the increments in terms of which it may be resized.  The \fBwm\fR
  38. command can take any of a number of different forms, depending on
  39. the \fIoption\fR argument.  All of the forms expect at least one
  40. additional argument, \fIwindow\fR, which must be the path name of a
  41. top-level window.
  42. .PP
  43. The legal forms for the \fBwm\fR command are:
  44. .TP
  45. \fBwm aspect \fIwindow\fR ?\fIminNumer minDenom maxNumer maxDenom\fR?
  46. If \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
  47. are all specified, then they will be passed to the window manager
  48. and the window manager should use them to enforce a range of
  49. acceptable aspect ratios for \fIwindow\fR.  The aspect ratio of
  50. \fIwindow\fR (width/length) will be constrained to lie
  51. between \fIminNumer\fR/\fIminDenom\fR and \fImaxNumer\fR/\fImaxDenom\fR.
  52. If \fIminNumer\fR etc. are all specified as empty strings, then
  53. any existing aspect ratio restrictions are removed.
  54. If \fIminNumer\fR etc. are specified, then the command returns an
  55. empty string.  Otherwise, it returns
  56. a Tcl list containing four elements, which are the current values
  57. of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
  58. (if no aspect restrictions are in effect, then an empty string is
  59. returned).
  60. .TP
  61. \fBwm client \fIwindow\fR ?\fIname\fR?
  62. .VS
  63. If \fIname\fR is specified, this command stores \fIname\fR (which
  64. should be the name of
  65. the host on which the application is executing) in \fIwindow\fR's
  66. \fBWM_CLIENT_MACHINE\fR property for use by the window manager or
  67. session manager.
  68. The command returns an empty string in this case.
  69. If \fIname\fR isn't specified, the command returns the last name
  70. set in a \fBwm client\fR command for \fIwindow\fR.
  71. If \fIname\fR is specified as an empty string, the command deletes the
  72. \fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR.
  73. .TP
  74. \fBwm command \fIwindow\fR ?\fIvalue\fR?
  75. If \fIvalue\fR is specified, this command stores \fIvalue\fR in \fIwindow\fR's
  76. \fBWM_COMMAND\fR property for use by the window manager or
  77. session manager and returns an empty string.
  78. \fIValue\fR must have proper list structure;  the elements should
  79. contain the words of the command used to invoke the application.
  80. If \fIvalue\fR isn't specified then the command returns the last value
  81. set in a \fBwm command\fR command for \fIwindow\fR.
  82. If \fIvalue\fR is specified as an empty string, the command
  83. deletes the \fBWM_COMMAND\fR property from \fIwindow\fR.
  84. .VE
  85. .TP
  86. \fBwm deiconify \fIwindow\fR
  87. Arrange for \fIwindow\fR to be displayed in normal (non-iconified) form.
  88. This is done by mapping the window.  If the window has never been
  89. mapped then this command will not map the window, but it will ensure
  90. that when the window is first mapped it will be displayed
  91. in de-iconified form.  Returns an empty string.
  92. .TP
  93. \fBwm focusmodel \fIwindow\fR ?\fBactive\fR|\fBpassive\fR?
  94. If \fBactive\fR or \fBpassive\fR is supplied as an optional argument
  95. to the command, then it specifies the focus model for \fIwindow\fR.
  96. In this case the command returns an empty string.  If no additional
  97. argument is supplied, then the command returns the current focus
  98. model for \fIwindow\fR.
  99. An \fBactive\fR focus model means that \fIwindow\fR will claim the
  100. input focus for itself or its descendants, even at times when
  101. the focus is currently in some other application.  \fBPassive\fR means that
  102. \fIwindow\fR will never claim the focus for itself:  the window manager
  103. should give the focus to \fIwindow\fR at appropriate times.  However,
  104. once the focus has been given to \fIwindow\fR or one of its descendants,
  105. the application may re-assign the focus among \fIwindow\fR's descendants.
  106. The focus model defaults to \fBpassive\fR, and Tk's \fBfocus\fR command
  107. assumes a passive model of focussing.
  108. .TP
  109. \fBwm frame \fIwindow\fR
  110. .VS
  111. If \fIwindow\fR has been reparented by the window manager into a
  112. decorative frame, the command returns the X window identifier for
  113. the outermost frame that contains \fIwindow\fR (the window whose
  114. parent is the root or virtual root).  If \fIwindow\fR hasn't been
  115. reparented by the window manager then the command returns the
  116. X window identifier for \fIwindow\fR.
  117. .VE
  118. .TP
  119. \fBwm geometry \fIwindow\fR ?\fInewGeometry\fR?
  120. If \fInewGeometry\fR is specified, then the geometry of \fIwindow\fR
  121. is changed and an empty string is returned.  Otherwise the current
  122. geometry for \fIwindow\fR is returned (this is the most recent
  123. geometry specified either by manual resizing or
  124. in a \fBwm geometry\fR command).  \fINewGeometry\fR has
  125. the form \fB=\fIwidth\fBx\fIheight\fB\(+-\fIx\fB\(+-\fIy\fR, where
  126. any of \fB=\fR, \fIwidth\fBx\fIheight\fR, or \fB\(+-\fIx\fB\(+-\fIy\fR
  127. may be omitted.  \fIWidth\fR and \fIheight\fR are positive integers
  128. specifying the desired dimensions of \fIwindow\fR.  If \fIwindow\fR
  129. is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions
  130. are specified in grid units;  otherwise they are specified in pixel
  131. units.  \fIX\fR and \fIy\fR specify the desired location of
  132. \fIwindow\fR on the screen, in pixels.
  133. If \fIx\fR is preceded by \fB+\fR, it specifies
  134. the number of pixels between the left edge of the screen and the left
  135. edge of \fIwindow\fR's border;  if preceded by \fB\-\fR then
  136. \fIx\fR specifies the number of pixels
  137. between the right edge of the screen and the right edge of \fIwindow\fR's
  138. border.  If \fIy\fR is preceded by \fB+\fR then it specifies the
  139. number of pixels between the top of the screen and the top
  140. of \fIwindow\fR's border;  if \fIy\fR is preceded by \fB\-\fR then
  141. it specifies the number of pixels between the bottom of \fIwindow\fR's
  142. border and the bottom of the screen.
  143. If \fInewGeometry\fR is specified as an empty string then any
  144. existing user-specified geometry for \fIwindow\fR is cancelled, and
  145. the window will revert to the size requested internally by its
  146. widgets.
  147. .TP
  148. \fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR?
  149. This command indicates that \fIwindow\fR is to be managed as a
  150. gridded window.
  151. It also specifies the relationship between grid units and pixel units.
  152. \fIBaseWidth\fR and \fIbaseHeight\fR specify the number of grid
  153. units corresponding to the pixel dimensions requested internally
  154. by \fIwindow\fR using \fBTk_GeometryRequest\fR.  \fIWidthInc\fR
  155. and \fIheightInc\fR specify the number of pixels in each horizontal
  156. and vertical grid unit.
  157. These four values determine a range of acceptable sizes for
  158. \fIwindow\fR, corresponding to grid-based widths and heights
  159. that are non-negative integers.
  160. Tk will pass this information to the window manager;  during
  161. manual resizing, the window manager will restrict the window's size
  162. to one of these acceptable sizes.
  163. Furthermore, during manual resizing the window manager will display
  164. the window's current size in terms of grid units rather than pixels.
  165. If \fIbaseWidth\fR etc. are all specified as empty strings, then
  166. \fIwindow\fR will no longer be managed as a gridded window.  If
  167. \fIbaseWidth\fR etc. are specified then the return value is an
  168. empty string.
  169. Otherwise the return value is a Tcl list containing
  170. four elements corresponding to the current \fIbaseWidth\fR,
  171. \fIbaseHeight\fR, \fIwidthInc\fR, and \fIheightInc\fR;  if
  172. \fIwindow\fR is not currently gridded, then an empty string
  173. is returned.
  174. Note: this command should not be needed very often, since the
  175. \fBTk_SetGrid\fR library procedure and the \fBsetGrid\fR option
  176. provide easier access to the same functionality.
  177. .TP
  178. \fBwm group \fIwindow\fR ?\fIpathName\fR?
  179. If \fIpathName\fR is specified, it gives the path name for the leader of
  180. a group of related windows.  The window manager may use this information,
  181. for example, to unmap all of the windows in a group when the group's
  182. leader is iconified.  \fIPathName\fR may be specified as an empty string to
  183. remove \fIwindow\fR from any group association.  If \fIpathName\fR is
  184. specified then the command returns an empty string;  otherwise it
  185. returns the path name of \fIwindow\fR's current group leader, or an empty
  186. string if \fIwindow\fR isn't part of any group.
  187. .TP
  188. \fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR?
  189. If \fIbitmap\fR is specified, then it names a bitmap in the standard
  190. forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details).
  191. This bitmap is passed to the window manager to be displayed in
  192. \fIwindow\fR's icon, and the command returns an empty string.  If
  193. an empty string is specified for \fIbitmap\fR, then any current icon
  194. bitmap is cancelled for \fIwindow\fR.
  195. If \fIbitmap\fR is specified then the command returns an empty string.
  196. Otherwise it returns the name of
  197. the current icon bitmap associated with \fIwindow\fR, or an empty
  198. string if \fIwindow\fR has no icon bitmap.
  199. .TP
  200. \fBwm iconify \fIwindow\fR
  201. Arrange for \fIwindow\fR to be iconified.  It \fIwindow\fR hasn't
  202. yet been mapped for the first time, this command will arrange for
  203. it to appear in the iconified state when it is eventually mapped.
  204. .TP
  205. \fBwm iconmask \fIwindow\fR ?\fIbitmap\fR?
  206. If \fIbitmap\fR is specified, then it names a bitmap in the standard
  207. forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details).
  208. This bitmap is passed to the window manager to be used as a mask
  209. in conjunction with the \fBiconbitmap\fR option:  where the mask
  210. has zeroes no icon will be displayed;  where it has ones, the bits
  211. from the icon bitmap will be displayed.  If
  212. an empty string is specified for \fIbitmap\fR then any current icon
  213. mask is cancelled for \fIwindow\fR (this is equivalent to specifying
  214. a bitmap of all ones).  If \fIbitmap\fR is specified
  215. then the command returns an empty string.  Otherwise it
  216. returns the name of the current icon mask associated with
  217. \fIwindow\fR, or an empty string if no mask is in effect.
  218. .TP
  219. \fBwm iconname \fIwindow\fR ?\fInewName\fR?
  220. If \fInewName\fR is specified, then it is passed to the window
  221. manager;  the window manager should display \fInewName\fR inside
  222. the icon associated with \fIwindow\fR.  In this case an empty
  223. string is returned as result.  If \fInewName\fR isn't specified
  224. then the command returns the current icon name for \fIwindow\fR,
  225. or an empty string if no icon name has been specified (in this
  226. case the window manager will normally display the window's title,
  227. as specified with the \fBwm title\fR command).
  228. .TP
  229. \fBwm iconposition \fIwindow\fR ?\fIx y\fR?
  230. If \fIx\fR and \fIy\fR are specified, they are passed to the window
  231. manager as a hint about where to position the icon for \fIwindow\fR.
  232. In this case an empty string is returned.  If \fIx\fR and \fIy\fR are
  233. specified as empty strings then any existing icon position hint is cancelled.
  234. If neither \fIx\fR nor \fIy\fR is specified, then the command returns
  235. a Tcl list containing two values, which are the current icon position
  236. hints (if no hints are in effect then an empty string is returned).
  237. .TP
  238. \fBwm iconwindow \fIwindow\fR ?\fIpathName\fR?
  239. If \fIpathName\fR is specified, it is the path name for a window to
  240. use as icon for \fIwindow\fR: when \fIwindow\fR is iconified then
  241. \fIpathName\fR should be mapped to serve as icon, and when \fIwindow\fR
  242. is de-iconified then \fIpathName\fR will be unmapped again.  If
  243. \fIpathName\fR is specified as an empty string then any existing
  244. icon window association for \fIwindow\fR will be cancelled.  If
  245. the \fIpathName\fR argument is specified then an empty string is
  246. returned.  Otherwise the command returns the path name of the
  247. current icon window for \fIwindow\fR, or an empty string if there
  248. is no icon window currently specified for \fIwindow\fR.  Note:
  249. not all window managers support the notion of an icon window.
  250. .TP
  251. \fBwm maxsize \fIwindow\fR ?\fIwidth height\fR?
  252. If \fIwidth\fR and \fIheight\fR are specified, then \fIwindow\fR
  253. becomes resizable and \fIwidth\fR and \fIheight\fR give its
  254. maximum permissible dimensions.
  255. For gridded windows the dimensions are specified in
  256. grid units;  otherwise they are specified in pixel units.
  257. During manual sizing, the window manager
  258. should restrict the window's dimensions to be less than or
  259. equal to \fIwidth\fR and \fIheight\fR.
  260. If \fIwidth\fR and \fIheight\fR are specified as empty strings,
  261. then the maximum size option is cancelled for \fIwindow\fR.
  262. If \fIwidth\fR and \fIheight\fR are
  263. specified, then the command returns an empty string.  Otherwise
  264. it returns a Tcl list with two elements, which are the
  265. maximum width and height currently in effect;  if no maximum
  266. dimensions are in effect for \fIwindow\fR then an empty
  267. string is returned.  See the sections on geometry management
  268. below for more information.
  269. .TP
  270. \fBwm minsize \fIwindow\fR ?\fIwidth height\fR?
  271. If \fIwidth\fR and \fIheight\fR are specified, then \fIwindow\fR
  272. becomes resizable and \fIwidth\fR and \fIheight\fR give its
  273. minimum permissible dimensions.
  274. For gridded windows the dimensions are specified in
  275. grid units;  otherwise they are specified in pixel units.
  276. During manual sizing, the window manager
  277. should restrict the window's dimensions to be greater than or
  278. equal to \fIwidth\fR and \fIheight\fR.
  279. If \fIwidth\fR and \fIheight\fR are specified as empty strings,
  280. then the minimum size option is cancelled for \fIwindow\fR.
  281. If \fIwidth\fR and \fIheight\fR are
  282. specified, then the command returns an empty string.  Otherwise
  283. it returns a Tcl list with two elements, which are the
  284. minimum width and height currently in effect;  if no minimum
  285. dimensions are in effect for \fIwindow\fR then an empty
  286. string is returned.  See the sections on geometry management
  287. below for more information.
  288. .TP
  289. \fBwm overrideredirect \fIwindow\fR ?\fIboolean\fR?
  290. .VS
  291. If \fIboolean\fR is specified, it must have a proper boolean form and
  292. the override-redirect flag for \fIwindow\fR is set to that value.
  293. If \fIboolean\fR is not specified then \fB1\fR or \fB0\fR is
  294. returned to indicate whether or not the override-redirect flag
  295. is currently set for \fIwindow\fR.
  296. Setting the override-redirect flag for a window causes
  297. it to be ignored by the window manager;  among other things, this means
  298. that the window will not be reparented from the root window into a
  299. decorative frame and the user will not be able to manipulate the
  300. window using the normal window manager mechanisms.
  301. .VE
  302. .TP
  303. \fBwm positionfrom \fIwindow\fR ?\fIwho\fR?
  304. If \fIwho\fR is specified, it must be either \fBprogram\fR or
  305. \fBuser\fR, or an abbreviation of one of these two.  It indicates
  306. whether \fIwindow\fR's current position was requested by the
  307. program or by the user.  Many window managers ignore program-requested
  308. initial positions and ask the user to manually position the window;  if
  309. \fBuser\fR is specified then the window manager should position the
  310. window at the given place without asking the user for assistance.
  311. If \fIwho\fR is specified as an empty string, then the current position
  312. source is cancelled.
  313. If \fIwho\fR is specified, then the command returns an empty string.
  314. Otherwise it returns \fBuser\fR or \fBwindow\fR to indicate the
  315. source of the window's current position, or an empty string if
  316. no source has been specified yet.  Most window managers interpret
  317. ``no source'' as equivalent to \fBprogram\fR.
  318. .VS
  319. Tk will automatically set the position source to \fBuser\fR
  320. when a \fBwm geometry\fR command is invoked, unless the source has
  321. been set explicitly to \fBprogram\fR.
  322. .TP
  323. \fBwm protocol \fIwindow\fR ?\fIname\fR? ?\fIcommand\fR?
  324. This command is used to manage window manager protocols such as
  325. \fBWM_DELETE_WINDOW\fR.
  326. \fIName\fR is the name of an atom corresponding to a window manager
  327. protocol, such as \fBWM_DELETE_WINDOW\fR or \fBWM_SAVE_YOURSELF\fR
  328. or \fBWM_TAKE_FOCUS\fR.
  329. If both \fIname\fR and \fIcommand\fR are specified, then \fIcommand\fR
  330. is associated with the protocol specified by \fIname\fR.
  331. \fIName\fR will be added to \fIwindow\fR's \fBWM_PROTOCOLS\fR
  332. property to tell the window manager that the application has a
  333. protocol handler for \fIname\fR, and \fIcommand\fR will
  334. be invoked in the future whenever the window manager sends a
  335. message to the client for that protocol.
  336. In this case the command returns an empty string.
  337. If \fIname\fR is specified but \fIcommand\fR isn't, then the current
  338. command for \fIname\fR is returned, or an empty string if there
  339. is no handler defined for \fIname\fR.
  340. If \fIcommand\fR is specified as an empty string then the current
  341. handler for \fIname\fR is deleted and it is removed from the
  342. \fBWM_PROTOCOLS\fR property on \fIwindow\fR;  an empty string is
  343. returned.
  344. Lastly, if neither \fIname\fR nor \fIcommand\fR is specified, the
  345. command returns a list of all the protocols for which handlers
  346. are currently defined for \fIwindow\fR.
  347. .RS
  348. .LP
  349. Tk always defines a protocol handler for \fBWM_DELETE_WINDOW\fR, even if
  350. you haven't asked for one with \fBwm protocol\fR.
  351. If a \fBWM_DELETE_WINDOW\fR message arrives when you haven't defined
  352. a handler, then Tk handles the message by destroying the window for
  353. which it was received.
  354. .RE
  355. .VE
  356. .TP
  357. \fBwm sizefrom \fIwindow\fR ?\fIwho\fR?
  358. If \fIwho\fR is specified, it must be either \fBprogram\fR or
  359. \fBuser\fR, or an abbreviation of one of these two.  It indicates
  360. whether \fIwindow\fR's current size was requested by the
  361. program or by the user.  Some window managers ignore program-requested
  362. sizes and ask the user to manually size the window;  if
  363. \fBuser\fR is specified then the window manager should give the
  364. window its specified size without asking the user for assistance.
  365. If \fIwho\fR is specified as an empty string, then the current size
  366. source is cancelled.
  367. If \fIwho\fR is specified, then the command returns an empty string.
  368. Otherwise it returns \fBuser\fR or \fBwindow\fR to indicate the
  369. source of the window's current size, or an empty string if
  370. no source has been specified yet.  Most window managers interpret
  371. ``no source'' as equivalent to \fBprogram\fR.
  372. .TP
  373. \fBwm state \fIwindow\fR
  374. .VS
  375. Returns the current state of \fIwindow\fR:  either \fBnormal\fR,
  376. \fBiconic\fR, or \fBwithdrawn\fR.
  377. .VE
  378. .TP
  379. \fBwm title \fIwindow\fR ?\fIstring\fR?
  380. If \fIstring\fR is specified, then it will be passed to the window
  381. manager for use as the title for \fIwindow\fR (the window manager
  382. should display this string in \fIwindow\fR's title bar).  In this
  383. case the command returns an empty string.  If \fIstring\fR isn't
  384. specified then the command returns the current title for the
  385. \fIwindow\fR.  The title for a window defaults to its name.
  386. .TP
  387. \fBwm transient \fIwindow\fR ?\fImaster\fR?
  388. If \fImaster\fR is specified, then the window manager is informed
  389. that \fIwindow\fR is a transient window (e.g. pull-down menu) working
  390. on behalf of \fImaster\fR (where \fImaster\fR is the
  391. path name for a top-level window).  Some window managers will use
  392. this information to manage \fIwindow\fR specially.  If \fImaster\fR
  393. is specified as an empty string then \fIwindow\fR is marked as not
  394. being a transient window any more.  If \fImaster\fR is specified,
  395. then the command returns an empty string.  Otherwise the command
  396. returns the path name of \fIwindow\fR's current master, or an
  397. empty string if \fIwindow\fR isn't currently a transient window.
  398. .TP
  399. \fBwm withdraw \fIwindow\fR
  400. Arranges for \fIwindow\fR to be withdrawn from the screen.  This
  401. causes the window to be unmapped and forgotten about by the window
  402. manager.  If the window
  403. .VS
  404. has never been mapped, then this command
  405. causes the window to be mapped in the withdrawn state.  Not all
  406. window managers appear to know how to handle windows that are
  407. mapped in the withdrawn state.
  408. .VE
  409. Note: it sometimes seems to be necessary to withdraw a
  410. window and then re-map it (e.g. with \fBwm deiconify\fR) to get some
  411. window managers to pay attention to changes in window attributes
  412. such as group.
  413.  
  414. .SH "SOURCES OF GEOMETRY INFORMATION"
  415. .PP
  416. Size-related information for top-level windows
  417. can come from three sources.
  418. First, geometry requests come from the widgets that are descendants
  419. of a top-level window.
  420. Each widget requests a particular size for itself
  421. by calling \fBTk_GeometryRequest\fR.  This information is passed to
  422. geometry managers, which then request large enough sizes for parent
  423. windows so that they can layout the children properly.
  424. Geometry information passes upwards through the window hierarchy
  425. until eventually a particular size is requested for each top-level
  426. window.
  427. These requests are called \fIinternal requests\fR in the discussion
  428. below.
  429. The second source of width and height information is through the
  430. \fBwm geometry\fR command.  Third, the user can
  431. request a particular size for a window using the
  432. interactive facilities of the window manager.
  433. The second and third types of geometry requests are called
  434. \fIexternal requests\fR in the discussion below;  Tk treats
  435. these two kinds of requests identically.
  436.  
  437. .SH "UNGRIDDED GEOMETRY MANAGEMENT"
  438. .PP
  439. Tk allows the geometry of a top-level window to be managed in
  440. either of two general ways: ungridded or gridded.
  441. The ungridded form occurs if no \fBwm grid\fR command
  442. has been issued for a top-level window.
  443. Ungridded management has several variants.
  444. In the simplest variant of ungridded windows,
  445. no \fBwm geometry\fR, \fBwm minsize\fR, or \fBwm maxsize\fR
  446. commands have been invoked either.
  447. In this case, the window's size is
  448. determined totally by the internal requests emanating from the
  449. widgets inside the window:  Tk will ask the window manager not to
  450. permit the user to resize the window interactively.
  451. .PP
  452. If a \fBwm geometry\fR command is invoked on an ungridded window,
  453. then the size in that command overrides any size requested by the
  454. window's widgets;  from now on, the window's size will be determined
  455. entirely by the most recent information from \fBwm geometry\fR
  456. commands.  To go back to using the size requested by the window's
  457. widgets, issue a \fBwm geometry\fR command with an empty \fIgeometry\fR
  458. string.
  459. .PP
  460. To enable interactive resizing of an ungridded window, one or both
  461. of the \fBwm maxsize\fR
  462. and \fBwm minsize\fR commands must be issued.
  463. The information from these commands will be passed to the window
  464. manager, and size changes within the specified range will be permitted.
  465. For ungridded windows the limits refer to the top-level window's
  466. dimensions in pixels.
  467. If only a \fBwm maxsize\fR command is issued then the minimum
  468. dimensions default to 1;  if only a \fBwm minsize\fR command is
  469. issued then there will be no limit on the maximum dimensions.
  470. If the size of a window is changed interactively, it has the same
  471. effect as if \fBwm geometry\fR had been invoked:  from now on, internal
  472. geometry requests will be ignored.
  473. To return to internal control over the window's size, issue a
  474. \fBwm geometry\fR command with an empty \fIgeometry\fR argument.
  475. If a window has been manually resized or moved, the \fBwm geometry\fR
  476. command will return the geometry that was requested interactively.
  477.  
  478. .SH "GRIDDED GEOMETRY MANAGEMENT"
  479. .PP
  480. The second style of geometry management is called \fIgridded\fR.
  481. This approach occurs when one of the widgets of an application
  482. supports a range of useful sizes.
  483. This occurs, for example, in a text editor where the scrollbars,
  484. menus, and other adornments are fixed in size but the edit widget
  485. can support any number of lines of text or characters per line.
  486. In this case, it is usually desirable to let the user specify the
  487. number of lines or characters-per-line, either with the
  488. \fBwm geometry\fR command or by interactively resizing the window.
  489. In the case of text, and in other interesting cases also, only
  490. discrete sizes of the window make sense, such as integral numbers
  491. of lines and characters-per-line;  arbitrary pixel sizes are not useful.
  492. .PP
  493. Gridded geometry management provides support for this kind of
  494. application.
  495. Tk (and the window manager) assume that there is a grid of some
  496. sort within the application and that the application should be
  497. resized in terms of \fIgrid units\fR rather than pixels.
  498. Gridded geometry management is typically invoked by turning on
  499. the \fBsetGrid\fR option for a widget;  it can also be invoked
  500. with the \fBwm grid\fR command or by calling \fBTk_SetGrid\fR.
  501. In each of these approaches the particular widget (or sometimes
  502. code in the application as a whole) specifies the relationship between 
  503. integral grid sizes for the window and pixel sizes.
  504. To return to non-gridded geometry management, invoke
  505. \fBwm grid\fR with empty argument strings.
  506. .PP
  507. When gridded geometry management is enabled then all the dimensions specified
  508. in \fBwm minsize\fR, \fBwm maxsize\fR, and \fBwm geometry\fR commands
  509. are treated as grid units rather than pixel units.
  510. Interactive resizing is automatically enabled, and it will be
  511. carried out in even numbers of grid units rather than pixels.
  512. By default there are no limits on the minimum or maximum dimensions
  513. of a gridded window.
  514. As with ungridded windows, interactive resizing has exactly the
  515. same effect as invoking the \fBwm geometry\fR command.
  516. For gridded windows, internally- and externally-requested dimensions
  517. work together: the externally-specified width and height determine
  518. the size of the window in grid units, and the information from the
  519. last \fBwm grid\fR command maps from grid units to pixel units.
  520.  
  521. .SH BUGS
  522. .PP
  523. The window manager interactions seem too complicated, especially
  524. for managing geometry.  Suggestions on how to simplify this would
  525. be greatly appreciated.
  526. .PP
  527. Most existing window managers appear to have bugs that affect the
  528. operation of the \fBwm\fR command.  For example, some changes won't
  529. take effect if the window is already active:  the window will have
  530. to be withdrawn and de-iconified in order to make the change happen.
  531.  
  532. .SH KEYWORDS
  533. aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager
  534.