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

  1. '\"
  2. '\" Copyright (c) 1992 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/place.n,v 1.4 93/04/01 09:52:51 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS place tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. place \- Geometry manager for fixed or rubber-sheet placement
  29. .VS
  30. .SH SYNOPSIS
  31. \fBplace \fIwindow option value \fR?\fIoption value ...\fR?
  32. .sp
  33. \fBplace configure \fIwindow option value \fR?\fIoption value ...\fR?
  34. .sp
  35. \fBplace forget \fIwindow\fR
  36. .sp
  37. \fBplace info \fIwindow\fR
  38. .sp
  39. \fBplace slaves \fIwindow\fR
  40. .VS
  41. .VE
  42. .BE
  43.  
  44. .SH DESCRIPTION
  45. .PP
  46. The placer is a geometry manager for Tk.
  47. It provides simple fixed placement of windows, where you specify
  48. the exact size and location of one window, called the \fIslave\fR,
  49. within another window, called the \fImaster\fR.
  50. The placer also provides rubber-sheet placement, where you specify the
  51. size and location of the slave in terms of the dimensions of
  52. the master, so that the slave changes size and location
  53. in response to changes in the size of the master.
  54. Lastly, the placer allows you to mix these styles of placement so
  55. that, for example, the slave has a fixed width and height but is
  56. centered inside the master.
  57. .PP
  58. If the first argument to the \fBplace\fR command is a window path
  59. name or \fBconfigure\fR then the command arranges for the placer
  60. to manage the geometry of a slave whose path name is \fIwindow\fR.
  61. The remaining arguments consist of one or more \fIoption\-value\fR
  62. pairs that specify the way in which \fIwindow\fR's
  63. geometry is managed.
  64. If the placer is already managing \fIwindow\fR, then the
  65. \fIoption\-value\fR pairs modify the configuration for \fIwindow\fR.
  66. In this form the \fBplace\fR command returns an empty string as result.
  67. The following \fIoption\-value\fR pairs are supported:
  68. .TP
  69. \fB\-in \fImaster\fR
  70. \fIMaster\fR specifes the path name of the window relative
  71. to which \fIwindow\fR is to be placed.
  72. \fIMaster\fR must either be \fIwindow\fR's parent or a descendant
  73. of \fIwindow\fR's parent.
  74. In addition, \fImaster\fR and \fIwindow\fR must both be descendants
  75. of the same top-level window.
  76. These restrictions are necessary to guarantee
  77. that \fIwindow\fR is visible whenever \fImaster\fR is visible.
  78. If this option isn't specified then the master defaults to
  79. \fIwindow\fR's parent.
  80. .TP
  81. \fB\-x \fIlocation\fR
  82. \fILocation\fR specifies the x-coordinate within the master window
  83. of the anchor point for \fIwindow\fR.
  84. The location is specified in screen units (i.e. any of the forms
  85. accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
  86. of the master window.
  87. .TP
  88. \fB\-relx \fIlocation\fR
  89. \fILocation\fR specifies the x-coordinate within the master window
  90. of the anchor point for \fIwindow\fR.
  91. In this case the location is specified in a relative fashion
  92. as a floating-point number:  0.0 corresponds to the left edge
  93. of the master and 1.0 corresponds to the right edge of the master.
  94. \fILocation\fR need not be in the range 0.0\-1.0.
  95. .TP
  96. \fB\-y \fIlocation\fR
  97. \fILocation\fR specifies the y-coordinate within the master window
  98. of the anchor point for \fIwindow\fR.
  99. The location is specified in screen units (i.e. any of the forms
  100. accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
  101. of the master window.
  102. .TP
  103. \fB\-rely \fIlocation\fR
  104. \fILocation\fR specifies the y-coordinate within the master window
  105. of the anchor point for \fIwindow\fR.
  106. In this case the value is specified in a relative fashion
  107. as a floating-point number:  0.0 corresponds to the top edge
  108. of the master and 1.0 corresponds to the bottom edge of the master.
  109. \fILocation\fR need not be in the range 0.0\-1.0.
  110. .TP
  111. \fB\-anchor \fIwhere\fR
  112. \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned
  113. at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR,
  114. \fB\-relx\fR, and \fB\-rely\fR options.
  115. The anchor point is in terms of the outer area of \fIwindow\fR
  116. including its border, if any.
  117. Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of
  118. \fIwindow\fR's border will appear at the given (x,y) location
  119. in the master.
  120. The anchor position defaults to \fBnw\fR.
  121. .TP
  122. \fB\-width \fIsize\fR
  123. \fISize\fR specifies the width for \fIwindow\fR in screen units
  124. (i.e. any of the forms accepted by \fBTk_GetPixels\fR).
  125. The width will be the outer width of \fIwindow\fR including its
  126. border, if any.
  127. If \fIsize\fR is an empty string, or if no \fB\-width\fR
  128. or \fB\-relwidth\fR option is specified, then the width requested
  129. internally by the window will be used.
  130. .TP
  131. \fB\-relwidth \fIsize\fR
  132. \fISize\fR specifies the width for \fIwindow\fR.
  133. In this case the width is specified as a floating-point number
  134. relative to the width of the master: 0.5 means \fIwindow\fR will
  135. be half as wide as the master, 1.0 means \fIwindow\fR will have
  136. the same width as the master, and so on.
  137. .TP
  138. \fB\-height \fIsize\fR
  139. \fISize\fR specifies the height for \fIwindow\fR in screen units
  140. (i.e. any of the forms accepted by \fBTk_GetPixels\fR).
  141. The height will be the outer dimension of \fIwindow\fR including its
  142. border, if any.
  143. If \fIsize\fR is an empty string, or if no \fB\-height\fR or
  144. \fB\-relheight\fR option is specified, then the height requested
  145. internally by the window will be used.
  146. .TP
  147. \fB\-relheight \fIsize\fR
  148. \fISize\fR specifies the height for \fIwindow\fR.
  149. In this case the height is specified as a floating-point number
  150. relative to the height of the master: 0.5 means \fIwindow\fR will
  151. be half as high as the master, 1.0 means \fIwindow\fR will have
  152. the same height as the master, and so on.
  153. .TP
  154. \fB\-bordermode \fImode\fR
  155. \fIMode\fR determines the degree to which borders within the
  156. master are used in determining the placement of the slave.
  157. The default and most common value is \fBinside\fR.
  158. In this case the placer considers the area of the master to
  159. be the innermost area of the master, inside any border:
  160. an option of \fB\-x 0\fR corresponds to an x-coordinate just
  161. inside the border and an option of \fB\-relwidth 1.0\fR
  162. means \fIwindow\fR will fill the area inside the master's
  163. border.
  164. If \fImode\fR is \fBoutside\fR then the placer considers
  165. the area of the master to include its border;
  166. this mode is typically used when placing \fIwindow\fR
  167. outside its master, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR.
  168. Lastly, \fImode\fR may be specified as \fBignore\fR, in which
  169. case borders are ignored:  the area of the master is considered
  170. to be its official X area, which includes any internal border but
  171. no external border.  A bordermode of \fBignore\fR is probably
  172. not very useful.
  173. .PP
  174. If the same value is specified separately with
  175. two different options, such as \fB\-x\fR and \fB\-relx\fR, then
  176. the most recent option is used and the older one is ignored.
  177. .PP
  178. The \fBplace slaves\fR command returns a list of all the slave
  179. .VS
  180. .VE
  181. windows for which \fIwindow\fR is the master.
  182. If there are no slaves for \fIwindow\fR then an empty string is
  183. returned.
  184. .PP
  185. The \fBplace forget\fR command causes the placer to stop managing
  186. the geometry of \fIwindow\fR.  As a side effect of this command
  187. \fIwindow\fR will be unmapped so that it doesn't appear on the
  188. screen.
  189. If \fIwindow\fR isn't currently managed by the placer then the
  190. command has no effect.
  191. \fBPlace forget\fR returns an empty string as result.
  192. .PP
  193. The \fBplace info\fR command returns a list giving the current
  194. configuration of \fIwindow\fR.
  195. The list consists of \fIoption\-value\fR pairs in exactly the
  196. same form as might be specified to the \fBplace configure\fR
  197. command.
  198. If the configuration of a window has been retrieved with
  199. \fBplace info\fR, that configuration can be restored later by
  200. first using \fBplace forget\fR to erase any existing information
  201. for the window and then invoking \fBplace configure\fR with
  202. the saved information.
  203.  
  204. .SH "FINE POINTS"
  205. .PP
  206. It is not necessary for the master window to be the parent
  207. of the slave window.
  208. This feature is useful in at least two situations.
  209. First, for complex window layouts it means you can create a
  210. hierarchy of subwindows whose only purpose
  211. is to assist in the layout of the parent.
  212. The ``real children'' of the parent (i.e. the windows that
  213. are significant for the application's user interface) can be
  214. children of the parent yet be placed inside the windows
  215. of the geometry-management hierarchy.
  216. This means that the path names of the ``real children''
  217. don't reflect the geometry-management hierarchy and users
  218. can specify options for the real children
  219. without being aware of the structure of the geometry-management
  220. hierarchy.
  221. .PP
  222. A second reason for having a master different than the slave's
  223. parent is to tie two siblings together.
  224. For example, the placer can be used to force a window always to
  225. be positioned centered just below one of its
  226. siblings by specifying the configuration
  227. .DS C
  228. \fB\-in \fIsibling\fB \-relx 0.5 \-rely 1.0 \-anchor n \-bordermode outside\fR
  229. .DE
  230. Whenever the sibling is repositioned in the future, the slave
  231. will be repositioned as well.
  232. .PP
  233. Unlike many other geometry managers (such as the packer)
  234. the placer does not make any attempt to manipulate the geometry of
  235. the master windows or the parents of slave windows (i.e. it doesn't
  236. set their requested sizes).
  237. To control the sizes of these windows, make them windows like
  238. frames and canvases that provide configuration options for this purpose.
  239.  
  240. .SH KEYWORDS
  241. geometry manager, height, location, master, place, rubber sheet, slave, width
  242. .VE
  243.