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