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

  1. '\"
  2. '\" Copyright (c) 1990-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/pack-old.n,v 1.3 93/07/01 13:35:49 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS pack-old tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. pack \- Obsolete syntax for packer geometry manager
  29. .SH SYNOPSIS
  30. \fBpack after \fIsibling \fIwindow options\fR ?\fIwindow options \fR...?
  31. .sp
  32. \fBpack append \fIparent \fIwindow options\fR ?\fIwindow options \fR...?
  33. .sp
  34. \fBpack before \fIsibling \fIwindow options\fR ?\fIwindow options \fR...?
  35. .sp
  36. \fBpack info \fIparent\fR
  37. .sp
  38. \fBpack unpack \fIwindow\fR
  39. .BE
  40.  
  41. .SH DESCRIPTION
  42. .PP
  43. \fINote: this manual entry describes the syntax for the \fBpack\fI
  44. command as it before Tk version 3.3.
  45. Although this syntax continues to be supported for backward
  46. compatibility, it is obsolete and should not be used anymore.
  47. At some point in the future it may cease to be supported.\fR
  48. .PP
  49. The packer is a geometry manager that arranges the
  50. children of a parent by packing them in order around the edges of
  51. the parent.  The first child is placed against one side of
  52. the window, occupying the entire span of the window along that
  53. side.  This reduces the space remaining for other children as
  54. if the side had been moved in by the size of the first child.
  55. Then the next child is placed against one side of the remaining
  56. cavity, and so on until all children have been placed or there
  57. is no space left in the cavity.
  58. .PP
  59. The \fBbefore\fR, \fBafter\fR, and \fBappend\fR forms of the \fBpack\fR
  60. command are used to insert one or more children into the packing order
  61. for their parent.  The \fBbefore\fR form inserts the children before
  62. window \fIsibling\fR in the order;  all of the other windows must be
  63. siblings of \fIsibling\fR.  The \fBafter\fR form inserts the windows
  64. after \fIsibling\fR, and the \fBappend\fR form appends one or more
  65. windows to the end of the packing order for \fIparent\fR.  If a
  66. \fIwindow\fR named in any of these commands is already packed in
  67. its parent, it is removed from its current position in the packing
  68. order and repositioned as indicated by the command.  All of these
  69. commands return an empty string as result.
  70. .PP
  71. .VS
  72. The \fBunpack\fR form of the \fBpack\fR command removes \fIwindow\fR
  73. from the packing order of its parent and unmaps it.  After the
  74. execution of this command the packer will no longer manage
  75. \fIwindow\fR's geometry.
  76. .VE
  77. .PP
  78. The placement of each child is actually a four-step process;
  79. the \fIoptions\fR argument following each \fIwindow\fR consists of
  80. a list of one or more fields that govern the placement of that
  81. window.  In the discussion below, the term \fIcavity\fR refers
  82. to the space left in a parent when a particular child is placed
  83. (i.e. all the space that wasn't claimed by earlier children in
  84. the packing order).  The term \fIframe\fR refers to the space
  85. allocated to a particular child;  this is not necessarily the
  86. same as the child window's final geometry.
  87. .PP
  88. The first step in placing a child is to determine which side of
  89. the cavity it will lie against.  Any one of the following options
  90. may be used to specify a side:
  91. .TP
  92. \fBtop\fR
  93. Position the child's frame against the top of the cavity,
  94. occupying the full width of the cavity.
  95. .TP
  96. \fBbottom\fR
  97. Position the child's frame against the bottom of the cavity,
  98. occupying the full width of the cavity.
  99. .TP
  100. \fBleft\fR
  101. Position the child's frame against the left side of the cavity,
  102. occupying the full height of the cavity.
  103. .TP
  104. \fBright\fR
  105. Position the child's frame against the right side of the cavity,
  106. occupying the full height of the cavity.
  107. .LP
  108. At most one of these options should be specified for any given window.
  109. If no side is specified, then the default is \fBtop\fR.
  110. .PP
  111. The second step is to decide on a frame for the child.  For \fBtop\fR
  112. and \fBbottom\fR windows, the desired frame width is normally the cavity
  113. width and the desired frame height is the window's requested height,
  114. as passed to \fBTk_GeometryRequest\fR. For \fBleft\fR and \fBright\fR
  115. windows, the desired frame height is normally the cavity height and the
  116. desired width is the window's requested width.  However, extra
  117. space may be requested for the window using any of the following
  118. options:
  119. .TP 12
  120. \fBpadx \fInum\fR
  121. Add \fInum\fR pixels to the window's requested width before computing
  122. the frame size as described above.
  123. .TP 12
  124. \fBpady \fInum\fR
  125. Add \fInum\fR pixels to the window's requested height before computing
  126. the frame size as described above.
  127. .TP 12
  128. \fBexpand\fR
  129. This option requests that the window's frame absorb any extra space left over
  130. in the parent's cavity after packing all the children.
  131. The amount of space left over depends on the sizes requested by the
  132. other children, and may be zero.  If several windows have all specified
  133. \fBexpand\fR then the extra width will be divided equally among all the
  134. \fBleft\fR and \fBright\fR windows that specified \fBexpand\fR and
  135. the extra height will be divided equally among all the \fBtop\fR and
  136. \fBbottom\fR windows that specified \fBexpand.
  137. .LP
  138. If the desired width or height for a frame is larger than the corresponding
  139. dimension of the cavity, then the cavity's dimension is used instead.
  140. .PP
  141. The third step in placing the window is to decide on the window's
  142. width and height.  The default is for the window to receive either
  143. its requested width and height or the those of the frame, whichever
  144. is smaller.  If the frame is larger than the window's requested
  145. size, then the following options may be used to expand the
  146. window to partially or completely fill the frame:
  147. .TP
  148. \fBfill\fR
  149. Set the window's size to equal the frame size.
  150. .TP
  151. \fBfillx\fR
  152. Increase the window's width to equal the frame's width, but retain
  153. the window's requested height.
  154. .TP
  155. \fBfilly\fR
  156. Increase the window's height to equal the frame's height, but retain
  157. the window's requested width.
  158. .PP
  159. The last step is to decide the window's location within its frame.
  160. If the window's size equals the frame's size, then the window simply
  161. fills the entire frame.  If the frame is larger than the window,
  162. then one of
  163. the following options may be used to specify where the window should
  164. be positioned within its frame:
  165. .TP 15
  166. \fBframe center\fR
  167. Center the window in its frame.  This is the default if no framing
  168. option is specified.
  169. .TP 15
  170. \fBframe n\fR
  171. Position the window with its top edge centered on the top edge of
  172. the frame.
  173. .TP 15
  174. \fBframe ne\fR
  175. Position the window with its upper-right corner at the upper-right corner
  176. of the frame.
  177. .TP 15
  178. \fBframe e\fR
  179. Position the window with its right edge centered on the right edge of
  180. the frame.
  181. .TP 15
  182. \fBframe se\fR
  183. Position the window with its lower-right corner at the lower-right corner
  184. of the frame.
  185. .TP 15
  186. \fBframe s\fR
  187. Position the window with its bottom edge centered on the bottom edge of
  188. the frame.
  189. .TP 15
  190. \fBframe sw\fR
  191. Position the window with its lower-left corner at the lower-left corner
  192. of the frame.
  193. .TP 15
  194. \fBframe w\fR
  195. Position the window with its left edge centered on the left edge of
  196. the frame.
  197. .TP 15
  198. \fBframe nw\fR
  199. Position the window with its upper-left corner at the upper-left corner
  200. of the frame.
  201. .PP
  202. The \fBpack info\fR command may be used to retrieve information about
  203. the packing order for a parent.  It returns a list in the form
  204. .DS C
  205. \fIwindow options window options ...\fR
  206. .DE
  207. Each \fIwindow\fR is a name of a window packed in \fIparent\fR,
  208. and the following \fIoptions\fR describes all of the options for that
  209. window, just as they would be typed to \fBpack append\fR.
  210. The order of the list is the same as the packing order for
  211. \fIparent\fR.
  212. .PP
  213. The packer manages the mapped/unmapped state of all the packed
  214. children windows.  It automatically maps the windows when it packs
  215. them, and it unmaps any windows for which there was no space left
  216. in the cavity.
  217. .PP
  218. The packer makes geometry requests on behalf of the parent windows
  219. it manages.  For each parent window it requests a size large enough
  220. to accommodate all the options specified by all the packed children,
  221. such that zero space would be leftover for \fBexpand\fR options.
  222.  
  223. .SH KEYWORDS
  224. frame, geometry manager, location, packer, size
  225.