Debian Codegraph @

info/gcl-tk/pack_002dold.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>pack-old (GCL TK Manual)</title>
7
8 <meta name="description" content="pack-old (GCL TK Manual)">
9 <meta name="keywords" content="pack-old (GCL TK Manual)">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="index.html" rel="start" title="Top">
14 <link href="wm.html#SEC_Contents" rel="contents" title="Table of Contents">
15 <link href="Control.html" rel="up" title="Control">
16 <link href="pack.html" rel="next" title="pack">
17 <link href="options.html" rel="prev" title="options">
18 <style type="text/css">
19 <!--
20 a.summary-letter {text-decoration: none}
21 blockquote.indentedblock {margin-right: 0em}
22 div.display {margin-left: 3.2em}
23 div.example {margin-left: 3.2em}
24 div.lisp {margin-left: 3.2em}
25 kbd {font-style: oblique}
26 pre.display {font-family: inherit}
27 pre.format {font-family: inherit}
28 pre.menu-comment {font-family: serif}
29 pre.menu-preformatted {font-family: serif}
30 span.nolinebreak {white-space: nowrap}
31 span.roman {font-family: initial; font-weight: normal}
32 span.sansserif {font-family: sans-serif; font-weight: normal}
33 ul.no-bullet {list-style: none}
34 -->
35 </style>
36
37
38 </head>
39
40 <body lang="en">
41 <span id="pack_002dold"></span><div class="header">
42 <p>
43 Next: <a href="pack.html" accesskey="n" rel="next">pack</a>, Previous: <a href="options.html" accesskey="p" rel="prev">options</a>, Up: <a href="Control.html" accesskey="u" rel="up">Control</a> &nbsp; [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
44 </div>
45 <hr>
46 <span id="pack_002dold-1"></span><h3 class="section">3.13 pack-old</h3>
47
48 <p>pack \- Obsolete syntax for packer geometry manager
49 </p><span id="Synopsis-26"></span><h4 class="unnumberedsubsec">Synopsis</h4>
50 <p><b>pack after </b><i>sibling </i><i>window options</i><span class="roman"> ?</span><i>window options </i>...?
51 </p><br>
52 <p><b>pack append </b><i>parent </i><i>window options</i><span class="roman"> ?</span><i>window options </i>...?
53 </p><br>
54 <p><b>pack before </b><i>sibling </i><i>window options</i><span class="roman"> ?</span><i>window options </i>...?
55 </p><br>
56 <p><b>pack info </b><i>parent</i>
57 </p><br>
58 <p><b>pack unpack </b><i>window</i>
59 </p>
60 <span id="Description-24"></span><h4 class="unnumberedsubsec">Description</h4>
61
62 <p><i>Note: this manual entry describes the syntax for the </i><b>pack</b>\fI
63 command as it before Tk version 3.3.
64 Although this syntax continues to be supported for backward
65 compatibility, it is obsolete and should not be used anymore.
66 At some point in the future it may cease to be supported.
67 </p>
68 <p>The packer is a geometry manager that arranges the
69 children of a parent by packing them in order around the edges of
70 the parent. The first child is placed against one side of
71 the window, occupying the entire span of the window along that
72 side. This reduces the space remaining for other children as
73 if the side had been moved in by the size of the first child.
74 Then the next child is placed against one side of the remaining
75 cavity, and so on until all children have been placed or there
76 is no space left in the cavity.
77 </p>
78 <p>The <b>before</b><span class="roman">, </span><b>after</b><span class="roman">, and </span><b>append</b><span class="roman"> forms of the </span><b>pack</b>
79 command are used to insert one or more children into the packing order
80 for their parent. The <b>before</b> form inserts the children before
81 window <i>sibling</i> in the order; all of the other windows must be
82 siblings of <i>sibling</i><span class="roman">. The </span><b>after</b> form inserts the windows
83 after <i>sibling</i><span class="roman">, and the </span><b>append</b> form appends one or more
84 windows to the end of the packing order for <i>parent</i>. If a
85 <i>window</i> named in any of these commands is already packed in
86 its parent, it is removed from its current position in the packing
87 order and repositioned as indicated by the command. All of these
88 commands return an empty string as result.
89 </p>
90 <p>The <b>unpack</b><span class="roman"> form of the </span><b>pack</b><span class="roman"> command removes </span><i>window</i>
91 from the packing order of its parent and unmaps it. After the
92 execution of this command the packer will no longer manage
93 <i>window</i>&rsquo;s geometry.
94 </p>
95 <p>The placement of each child is actually a four-step process;
96 the <i>options</i><span class="roman"> argument following each </span><i>window</i> consists of
97 a list of one or more fields that govern the placement of that
98 window. In the discussion below, the term <i>cavity</i> refers
99 to the space left in a parent when a particular child is placed
100 (i.e. all the space that wasn&rsquo;t claimed by earlier children in
101 the packing order). The term <i>parcel</i> refers to the space
102 allocated to a particular child; this is not necessarily the
103 same as the child window&rsquo;s final geometry.
104 </p>
105 <p>The first step in placing a child is to determine which side of
106 the cavity it will lie against. Any one of the following options
107 may be used to specify a side:
108 </p>
109 <dl compact="compact">
110 <dt><b>top</b></dt>
111 <dd><p>Position the child&rsquo;s parcel against the top of the cavity,
112 occupying the full width of the cavity.
113 </p></dd>
114 <dt><b>bottom</b></dt>
115 <dd><p>Position the child&rsquo;s parcel against the bottom of the cavity,
116 occupying the full width of the cavity.
117 </p></dd>
118 <dt><b>left</b></dt>
119 <dd><p>Position the child&rsquo;s parcel against the left side of the cavity,
120 occupying the full height of the cavity.
121 </p></dd>
122 <dt><b>right</b></dt>
123 <dd><p>Position the child&rsquo;s parcel against the right side of the cavity,
124 occupying the full height of the cavity.
125 </p></dd>
126 </dl>
127
128
129 <p>At most one of these options should be specified for any given window.
130 If no side is specified, then the default is <b>top</b>.
131 </p>
132 <p>The second step is to decide on a parcel for the child. For <b>top</b>
133 and <b>bottom</b> windows, the desired parcel width is normally the cavity
134 width and the desired parcel height is the window&rsquo;s requested height,
135 as passed to <b>Tk_GeometryRequest</b><span class="roman">. For </span><b>left</b><span class="roman"> and </span><b>right</b>
136 windows, the desired parcel height is normally the cavity height and the
137 desired width is the window&rsquo;s requested width. However, extra
138 space may be requested for the window using any of the following
139 options:
140 </p>
141 <dl compact="compact">
142 <dt><b>padx </b><i>num</i></dt>
143 <dd><p>Add <i>num</i> pixels to the window&rsquo;s requested width before computing
144 the parcel size as described above.
145 </p></dd>
146 <dt><b>pady </b><i>num</i></dt>
147 <dd><p>Add <i>num</i> pixels to the window&rsquo;s requested height before computing
148 the parcel size as described above.
149 </p></dd>
150 <dt><b>expand</b></dt>
151 <dd><p>This option requests that the window&rsquo;s parcel absorb any extra space left over
152 in the parent&rsquo;s cavity after packing all the children.
153 The amount of space left over depends on the sizes requested by the
154 other children, and may be zero. If several windows have all specified
155 <b>expand</b> then the extra width will be divided equally among all the
156 <b>left</b><span class="roman"> and </span><b>right</b><span class="roman"> windows that specified </span><b>expand</b> and
157 the extra height will be divided equally among all the <b>top</b> and
158 <b>bottom</b><span class="roman"> windows that specified </span><b>expand</b>.
159 </p></dd>
160 </dl>
161
162
163 <p>If the desired width or height for a parcel is larger than the corresponding
164 dimension of the cavity, then the cavity&rsquo;s dimension is used instead.
165 </p>
166 <p>The third step in placing the window is to decide on the window&rsquo;s
167 width and height. The default is for the window to receive either
168 its requested width and height or the those of the parcel, whichever
169 is smaller. If the parcel is larger than the window&rsquo;s requested
170 size, then the following options may be used to expand the
171 window to partially or completely fill the parcel:
172 </p>
173 <dl compact="compact">
174 <dt><b>fill</b></dt>
175 <dd><p>Set the window&rsquo;s size to equal the parcel size.
176 </p></dd>
177 <dt><b>fillx</b></dt>
178 <dd><p>Increase the window&rsquo;s width to equal the parcel&rsquo;s width, but retain
179 the window&rsquo;s requested height.
180 </p></dd>
181 <dt><b>filly</b></dt>
182 <dd><p>Increase the window&rsquo;s height to equal the parcel&rsquo;s height, but retain
183 the window&rsquo;s requested width.
184 </p>
185 <p>The last step is to decide the window&rsquo;s location within its parcel.
186 If the window&rsquo;s size equals the parcel&rsquo;s size, then the window simply
187 fills the entire parcel. If the parcel is larger than the window,
188 then one of
189 the following options may be used to specify where the window should
190 be positioned within its parcel:
191 </p></dd>
192 <dt><b>frame center</b></dt>
193 <dd><p>Center the window in its parcel. This is the default if no framing
194 option is specified.
195 </p></dd>
196 <dt><b>frame n</b></dt>
197 <dd><p>Position the window with its top edge centered on the top edge of
198 the parcel.
199 </p></dd>
200 <dt><b>frame ne</b></dt>
201 <dd><p>Position the window with its upper-right corner at the upper-right corner
202 of the parcel.
203 </p></dd>
204 <dt><b>frame e</b></dt>
205 <dd><p>Position the window with its right edge centered on the right edge of
206 the parcel.
207 </p></dd>
208 <dt><b>frame se</b></dt>
209 <dd><p>Position the window with its lower-right corner at the lower-right corner
210 of the parcel.
211 </p></dd>
212 <dt><b>frame s</b></dt>
213 <dd><p>Position the window with its bottom edge centered on the bottom edge of
214 the parcel.
215 </p></dd>
216 <dt><b>frame sw</b></dt>
217 <dd><p>Position the window with its lower-left corner at the lower-left corner
218 of the parcel.
219 </p></dd>
220 <dt><b>frame w</b></dt>
221 <dd><p>Position the window with its left edge centered on the left edge of
222 the parcel.
223 </p></dd>
224 <dt><b>frame nw</b></dt>
225 <dd><p>Position the window with its upper-left corner at the upper-left corner
226 of the parcel.
227 </p>
228 <p>The <b>pack info</b> command may be used to retrieve information about
229 the packing order for a parent. It returns a list in the form
230 </p>
231 <div class="example">
232 <pre class="example"><i>window options window options ...</i>
233 </pre></div>
234
235 <p>Each <i>window</i><span class="roman"> is a name of a window packed in </span><i>parent</i>,
236 and the following <i>options</i> describes all of the options for that
237 window, just as they would be typed to <b>pack append</b>.
238 The order of the list is the same as the packing order for
239 <i>parent</i>.
240 </p>
241 <p>The packer manages the mapped/unmapped state of all the packed
242 children windows. It automatically maps the windows when it packs
243 them, and it unmaps any windows for which there was no space left
244 in the cavity.
245 </p>
246 <p>The packer makes geometry requests on behalf of the parent windows
247 it manages. For each parent window it requests a size large enough
248 to accommodate all the options specified by all the packed children,
249 such that zero space would be leftover for <b>expand</b> options.
250 </p>
251 </dd>
252 </dl>
253 <span id="Keywords-27"></span><h4 class="unnumberedsubsec">Keywords</h4>
254 <p>geometry manager, location, packer, parcel, size
255 </p><hr>
256 <div class="header">
257 <p>
258 Next: <a href="pack.html" accesskey="n" rel="next">pack</a>, Previous: <a href="options.html" accesskey="p" rel="prev">options</a>, Up: <a href="Control.html" accesskey="u" rel="up">Control</a> &nbsp; [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
259 </div>
260
261
262
263 </body>
264 </html>