home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / man.n / place.n < prev    next >
Encoding:
Text File  |  1995-07-21  |  14.0 KB  |  424 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. .\" The definitions below are for supplemental macros used in Tcl/Tk
  24. .\" manual entries.
  25. .\"
  26. .\" .HS name section [date [version]]
  27. .\"    Replacement for .TH in other man pages.  See below for valid
  28. .\"    section names.
  29. .\"
  30. .\" .AP type name in/out [indent]
  31. .\"    Start paragraph describing an argument to a library procedure.
  32. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  33. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  34. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  35. .\"    needed;  use .AS below instead)
  36. .\"
  37. .\" .AS [type [name]]
  38. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  39. .\"    name are examples of largest possible arguments that will be passed
  40. .\"    to .AP later.  If args are omitted, default tab stops are used.
  41. .\"
  42. .\" .BS
  43. .\"    Start box enclosure.  From here until next .BE, everything will be
  44. .\"    enclosed in one large box.
  45. .\"
  46. .\" .BE
  47. .\"    End of box enclosure.
  48. .\"
  49. .\" .VS
  50. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  51. .\"    of man pages.
  52. .\"
  53. .\" .VE
  54. .\"    End of vertical sidebar.
  55. .\"
  56. .\" .DS
  57. .\"    Begin an indented unfilled display.
  58. .\"
  59. .\" .DE
  60. .\"    End of indented unfilled display.
  61. .\"
  62. '\"    # Heading for Tcl/Tk man pages
  63. .de HS
  64. .ds ^3 \\0
  65. .if !"\\$3"" .ds ^3 \\$3
  66. .if '\\$2'cmds'       .TH \\$1 1 \\*(^3 \\$4
  67. .if '\\$2'lib'        .TH \\$1 3 \\*(^3 \\$4
  68. .if '\\$2'tcl'        .TH \\$1 n \\*(^3 Tcl "Tcl Built-In Commands"
  69. .if '\\$2'tk'         .TH \\$1 n \\*(^3 Tk "Tk Commands"
  70. .if '\\$2'tclc'        .TH \\$1 3 \\*(^3 Tcl "Tcl Library Procedures"
  71. .if '\\$2'tkc'         .TH \\$1 3 \\*(^3 Tk "Tk Library Procedures"
  72. .if '\\$2'tclcmds'         .TH \\$1 1 \\*(^3 Tk "Tcl Applications"
  73. .if '\\$2'tkcmds'         .TH \\$1 1 \\*(^3 Tk "Tk Applications"
  74. .if t .wh -1.3i ^B
  75. .nr ^l \\n(.l
  76. .ad b
  77. ..
  78. '\"    # Start an argument description
  79. .de AP
  80. .ie !"\\$4"" .TP \\$4
  81. .el \{\
  82. .   ie !"\\$2"" .TP \\n()Cu
  83. .   el          .TP 15
  84. .\}
  85. .ie !"\\$3"" \{\
  86. .ta \\n()Au \\n()Bu
  87. \&\\$1    \\fI\\$2\\fP    (\\$3)
  88. .\".b
  89. .\}
  90. .el \{\
  91. .br
  92. .ie !"\\$2"" \{\
  93. \&\\$1    \\fI\\$2\\fP
  94. .\}
  95. .el \{\
  96. \&\\fI\\$1\\fP
  97. .\}
  98. .\}
  99. ..
  100. '\"    # define tabbing values for .AP
  101. .de AS
  102. .nr )A 10n
  103. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  104. .nr )B \\n()Au+15n
  105. .\"
  106. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  107. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  108. ..
  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. .mk ^Y
  146. .ie n 'mc \s12\(br\s0
  147. .el .nr ^v 1u
  148. ..
  149. '\"    # VE - end of vertical sidebar
  150. .de VE
  151. .ie n 'mc
  152. .el \{\
  153. .ev 2
  154. .nf
  155. .ti 0
  156. .mk ^t
  157. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  158. .sp -1
  159. .fi
  160. .ev
  161. .\}
  162. .nr ^v 0
  163. ..
  164. '\"    # Special macro to handle page bottom:  finish off current
  165. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  166. '\"    # page bottom macro.
  167. .de ^B
  168. .ev 2
  169. 'ti 0
  170. 'nf
  171. .mk ^t
  172. .if \\n(^b \{\
  173. .\"    Draw three-sided box if this is the box's first page,
  174. .\"    draw two sides but no top otherwise.
  175. .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
  176. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  177. .\}
  178. .if \\n(^v \{\
  179. .nr ^x \\n(^tu+1v-\\n(^Yu
  180. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  181. .\}
  182. .bp
  183. 'fi
  184. .ev
  185. .if \\n(^b \{\
  186. .mk ^y
  187. .nr ^b 2
  188. .\}
  189. .if \\n(^v \{\
  190. .mk ^Y
  191. .\}
  192. ..
  193. '\"    # DS - begin display
  194. .de DS
  195. .RS
  196. .nf
  197. .sp
  198. ..
  199. '\"    # DE - end display
  200. .de DE
  201. .fi
  202. .RE
  203. .sp .5
  204. ..
  205. .HS place tk
  206. .BS
  207. '\" Note:  do not modify the .SH NAME line immediately below!
  208. .SH NAME
  209. place \- Geometry manager for fixed or rubber-sheet placement
  210. .VS
  211. .SH SYNOPSIS
  212. \fBplace \fIwindow option value \fR?\fIoption value ...\fR?
  213. .sp
  214. \fBplace configure \fIwindow option value \fR?\fIoption value ...\fR?
  215. .sp
  216. \fBplace forget \fIwindow\fR
  217. .sp
  218. \fBplace info \fIwindow\fR
  219. .sp
  220. \fBplace slaves \fIwindow\fR
  221. .VS
  222. .VE
  223. .BE
  224.  
  225. .SH DESCRIPTION
  226. .PP
  227. The placer is a geometry manager for Tk.
  228. It provides simple fixed placement of windows, where you specify
  229. the exact size and location of one window, called the \fIslave\fR,
  230. within another window, called the \fImaster\fR.
  231. The placer also provides rubber-sheet placement, where you specify the
  232. size and location of the slave in terms of the dimensions of
  233. the master, so that the slave changes size and location
  234. in response to changes in the size of the master.
  235. Lastly, the placer allows you to mix these styles of placement so
  236. that, for example, the slave has a fixed width and height but is
  237. centered inside the master.
  238. .PP
  239. If the first argument to the \fBplace\fR command is a window path
  240. name or \fBconfigure\fR then the command arranges for the placer
  241. to manage the geometry of a slave whose path name is \fIwindow\fR.
  242. The remaining arguments consist of one or more \fIoption\-value\fR
  243. pairs that specify the way in which \fIwindow\fR's
  244. geometry is managed.
  245. If the placer is already managing \fIwindow\fR, then the
  246. \fIoption\-value\fR pairs modify the configuration for \fIwindow\fR.
  247. In this form the \fBplace\fR command returns an empty string as result.
  248. The following \fIoption\-value\fR pairs are supported:
  249. .TP
  250. \fB\-in \fImaster\fR
  251. \fIMaster\fR specifes the path name of the window relative
  252. to which \fIwindow\fR is to be placed.
  253. \fIMaster\fR must either be \fIwindow\fR's parent or a descendant
  254. of \fIwindow\fR's parent.
  255. In addition, \fImaster\fR and \fIwindow\fR must both be descendants
  256. of the same top-level window.
  257. These restrictions are necessary to guarantee
  258. that \fIwindow\fR is visible whenever \fImaster\fR is visible.
  259. If this option isn't specified then the master defaults to
  260. \fIwindow\fR's parent.
  261. .TP
  262. \fB\-x \fIlocation\fR
  263. \fILocation\fR specifies the x-coordinate within the master window
  264. of the anchor point for \fIwindow\fR.
  265. The location is specified in screen units (i.e. any of the forms
  266. accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
  267. of the master window.
  268. .TP
  269. \fB\-relx \fIlocation\fR
  270. \fILocation\fR specifies the x-coordinate within the master window
  271. of the anchor point for \fIwindow\fR.
  272. In this case the location is specified in a relative fashion
  273. as a floating-point number:  0.0 corresponds to the left edge
  274. of the master and 1.0 corresponds to the right edge of the master.
  275. \fILocation\fR need not be in the range 0.0\-1.0.
  276. .TP
  277. \fB\-y \fIlocation\fR
  278. \fILocation\fR specifies the y-coordinate within the master window
  279. of the anchor point for \fIwindow\fR.
  280. The location is specified in screen units (i.e. any of the forms
  281. accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
  282. of the master window.
  283. .TP
  284. \fB\-rely \fIlocation\fR
  285. \fILocation\fR specifies the y-coordinate within the master window
  286. of the anchor point for \fIwindow\fR.
  287. In this case the value is specified in a relative fashion
  288. as a floating-point number:  0.0 corresponds to the top edge
  289. of the master and 1.0 corresponds to the bottom edge of the master.
  290. \fILocation\fR need not be in the range 0.0\-1.0.
  291. .TP
  292. \fB\-anchor \fIwhere\fR
  293. \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned
  294. at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR,
  295. \fB\-relx\fR, and \fB\-rely\fR options.
  296. The anchor point is in terms of the outer area of \fIwindow\fR
  297. including its border, if any.
  298. Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of
  299. \fIwindow\fR's border will appear at the given (x,y) location
  300. in the master.
  301. The anchor position defaults to \fBnw\fR.
  302. .TP
  303. \fB\-width \fIsize\fR
  304. \fISize\fR specifies the width for \fIwindow\fR in screen units
  305. (i.e. any of the forms accepted by \fBTk_GetPixels\fR).
  306. The width will be the outer width of \fIwindow\fR including its
  307. border, if any.
  308. If \fIsize\fR is an empty string, or if no \fB\-width\fR
  309. or \fB\-relwidth\fR option is specified, then the width requested
  310. internally by the window will be used.
  311. .TP
  312. \fB\-relwidth \fIsize\fR
  313. \fISize\fR specifies the width for \fIwindow\fR.
  314. In this case the width is specified as a floating-point number
  315. relative to the width of the master: 0.5 means \fIwindow\fR will
  316. be half as wide as the master, 1.0 means \fIwindow\fR will have
  317. the same width as the master, and so on.
  318. .TP
  319. \fB\-height \fIsize\fR
  320. \fISize\fR specifies the height for \fIwindow\fR in screen units
  321. (i.e. any of the forms accepted by \fBTk_GetPixels\fR).
  322. The height will be the outer dimension of \fIwindow\fR including its
  323. border, if any.
  324. If \fIsize\fR is an empty string, or if no \fB\-height\fR or
  325. \fB\-relheight\fR option is specified, then the height requested
  326. internally by the window will be used.
  327. .TP
  328. \fB\-relheight \fIsize\fR
  329. \fISize\fR specifies the height for \fIwindow\fR.
  330. In this case the height is specified as a floating-point number
  331. relative to the height of the master: 0.5 means \fIwindow\fR will
  332. be half as high as the master, 1.0 means \fIwindow\fR will have
  333. the same height as the master, and so on.
  334. .TP
  335. \fB\-bordermode \fImode\fR
  336. \fIMode\fR determines the degree to which borders within the
  337. master are used in determining the placement of the slave.
  338. The default and most common value is \fBinside\fR.
  339. In this case the placer considers the area of the master to
  340. be the innermost area of the master, inside any border:
  341. an option of \fB\-x 0\fR corresponds to an x-coordinate just
  342. inside the border and an option of \fB\-relwidth 1.0\fR
  343. means \fIwindow\fR will fill the area inside the master's
  344. border.
  345. If \fImode\fR is \fBoutside\fR then the placer considers
  346. the area of the master to include its border;
  347. this mode is typically used when placing \fIwindow\fR
  348. outside its master, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR.
  349. Lastly, \fImode\fR may be specified as \fBignore\fR, in which
  350. case borders are ignored:  the area of the master is considered
  351. to be its official X area, which includes any internal border but
  352. no external border.  A bordermode of \fBignore\fR is probably
  353. not very useful.
  354. .PP
  355. If the same value is specified separately with
  356. two different options, such as \fB\-x\fR and \fB\-relx\fR, then
  357. the most recent option is used and the older one is ignored.
  358. .PP
  359. The \fBplace slaves\fR command returns a list of all the slave
  360. .VS
  361. .VE
  362. windows for which \fIwindow\fR is the master.
  363. If there are no slaves for \fIwindow\fR then an empty string is
  364. returned.
  365. .PP
  366. The \fBplace forget\fR command causes the placer to stop managing
  367. the geometry of \fIwindow\fR.  As a side effect of this command
  368. \fIwindow\fR will be unmapped so that it doesn't appear on the
  369. screen.
  370. If \fIwindow\fR isn't currently managed by the placer then the
  371. command has no effect.
  372. \fBPlace forget\fR returns an empty string as result.
  373. .PP
  374. The \fBplace info\fR command returns a list giving the current
  375. configuration of \fIwindow\fR.
  376. The list consists of \fIoption\-value\fR pairs in exactly the
  377. same form as might be specified to the \fBplace configure\fR
  378. command.
  379. If the configuration of a window has been retrieved with
  380. \fBplace info\fR, that configuration can be restored later by
  381. first using \fBplace forget\fR to erase any existing information
  382. for the window and then invoking \fBplace configure\fR with
  383. the saved information.
  384.  
  385. .SH "FINE POINTS"
  386. .PP
  387. It is not necessary for the master window to be the parent
  388. of the slave window.
  389. This feature is useful in at least two situations.
  390. First, for complex window layouts it means you can create a
  391. hierarchy of subwindows whose only purpose
  392. is to assist in the layout of the parent.
  393. The ``real children'' of the parent (i.e. the windows that
  394. are significant for the application's user interface) can be
  395. children of the parent yet be placed inside the windows
  396. of the geometry-management hierarchy.
  397. This means that the path names of the ``real children''
  398. don't reflect the geometry-management hierarchy and users
  399. can specify options for the real children
  400. without being aware of the structure of the geometry-management
  401. hierarchy.
  402. .PP
  403. A second reason for having a master different than the slave's
  404. parent is to tie two siblings together.
  405. For example, the placer can be used to force a window always to
  406. be positioned centered just below one of its
  407. siblings by specifying the configuration
  408. .DS C
  409. \fB\-in \fIsibling\fB \-relx 0.5 \-rely 1.0 \-anchor n \-bordermode outside\fR
  410. .DE
  411. Whenever the sibling is repositioned in the future, the slave
  412. will be repositioned as well.
  413. .PP
  414. Unlike many other geometry managers (such as the packer)
  415. the placer does not make any attempt to manipulate the geometry of
  416. the master windows or the parents of slave windows (i.e. it doesn't
  417. set their requested sizes).
  418. To control the sizes of these windows, make them windows like
  419. frames and canvases that provide configuration options for this purpose.
  420.  
  421. .SH KEYWORDS
  422. geometry manager, height, location, master, place, rubber sheet, slave, width
  423. .VE
  424.