1 |
578 |
markom |
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<TITLE>iwidgets2.2.0 User Commands - panedwindow</TITLE>
|
4 |
|
|
</HEAD>
|
5 |
|
|
<BODY BGCOLOR="#FFFFFF">
|
6 |
|
|
<H1>iwidgets2.2.0 User Commands - panedwindow</H1>
|
7 |
|
|
<HR>
|
8 |
|
|
<PRE>
|
9 |
|
|
|
10 |
|
|
</PRE>
|
11 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
</PRE>
|
15 |
|
|
<H2>NAME</H2><PRE>
|
16 |
|
|
panedwindow - Create and manipulate a paned window widget
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
</PRE>
|
20 |
|
|
<H2>SYNOPSIS</H2><PRE>
|
21 |
|
|
<STRONG>panedwindow</STRONG> <EM>pathName</EM> ?<EM>options</EM>?
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
</PRE>
|
25 |
|
|
<H2>INHERITANCE</H2><PRE>
|
26 |
|
|
itk::Widget <- panedwindow
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
</PRE>
|
30 |
|
|
<H2>STANDARD OPTIONS</H2><PRE>
|
31 |
|
|
<STRONG>background</STRONG> <STRONG>cursor</STRONG>
|
32 |
|
|
|
33 |
|
|
See the "options" manual entry for details on the standard
|
34 |
|
|
options.
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
</PRE>
|
38 |
|
|
<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE>
|
39 |
|
|
Name: <STRONG>height</STRONG>
|
40 |
|
|
Class: <STRONG>Height</STRONG>
|
41 |
|
|
Command-Line Switch: <STRONG>-height</STRONG>
|
42 |
|
|
|
43 |
|
|
Specifies the overall height of the paned window in any
|
44 |
|
|
of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. The default
|
45 |
|
|
is 10 pixels.
|
46 |
|
|
|
47 |
|
|
Name: <STRONG>orient</STRONG>
|
48 |
|
|
Class: <STRONG>Orient</STRONG>
|
49 |
|
|
Command-Line Switch: <STRONG>-orient</STRONG>
|
50 |
|
|
|
51 |
|
|
Specifies the orientation of the separators: <STRONG>vertical</STRONG>
|
52 |
|
|
or <STRONG>horizontal</STRONG>. The default is horizontal.
|
53 |
|
|
|
54 |
|
|
Name: <STRONG>sashBorderWidth</STRONG>
|
55 |
|
|
Class: <STRONG>BorderWidth</STRONG>
|
56 |
|
|
Command-Line Switch: <STRONG>-sashborderwidth</STRONG>
|
57 |
|
|
|
58 |
|
|
Specifies a value indicating the width of the 3-D
|
59 |
|
|
border to draw around the outside of the sash in any of
|
60 |
|
|
the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. The default is 2
|
61 |
|
|
pixels.
|
62 |
|
|
|
63 |
|
|
Name: <STRONG>sashCursor</STRONG>
|
64 |
|
|
Class: <STRONG>Cursor</STRONG>
|
65 |
|
|
Command-Line Switch: <STRONG>-sashcursor</STRONG>
|
66 |
|
|
|
67 |
|
|
Specifies the type of cursor to be displayed in the
|
68 |
|
|
sash. The default is crosshair.
|
69 |
|
|
|
70 |
|
|
Name: <STRONG>sashHeight</STRONG>
|
71 |
|
|
Class: <STRONG>Height</STRONG>
|
72 |
|
|
Command-Line Switch: <STRONG>-sashheight</STRONG>
|
73 |
|
|
Specifies the height of the sash in any of the forms
|
74 |
|
|
acceptable to <STRONG>Tk_GetPixels</STRONG>. The default is 10 pixels.
|
75 |
|
|
|
76 |
|
|
Name: <STRONG>sashIndent</STRONG>
|
77 |
|
|
Class: <STRONG>SashIndent</STRONG>
|
78 |
|
|
Command-Line Switch <STRONG>sashindent</STRONG>
|
79 |
|
|
|
80 |
|
|
Specifies the placement of the sash along the panes in
|
81 |
|
|
any of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. A posi-
|
82 |
|
|
tive value causes the sash to be offset from the near
|
83 |
|
|
(left/top) side of the pane, and a negative value
|
84 |
|
|
causes the sash to be offset from the far
|
85 |
|
|
(right/bottom) side. If the offset is greater than the
|
86 |
|
|
width, then the sash is placed flush against the side.
|
87 |
|
|
The default is -10 pixels.
|
88 |
|
|
|
89 |
|
|
Name: <STRONG>sashWidth</STRONG>
|
90 |
|
|
Class: <STRONG>Width</STRONG>
|
91 |
|
|
Command-Line Switch: <STRONG>-sashwidth</STRONG>
|
92 |
|
|
|
93 |
|
|
Specifies the width of the sash in any of the forms
|
94 |
|
|
acceptable to <STRONG>Tk_GetPixels</STRONG>. The default is 10 pixels.
|
95 |
|
|
|
96 |
|
|
Name: <STRONG>thickness</STRONG>
|
97 |
|
|
Class: <STRONG>Thickness</STRONG>
|
98 |
|
|
Command-Line Switch: <STRONG>-thickness</STRONG>
|
99 |
|
|
|
100 |
|
|
Specifies the thickness of the separators in any of the
|
101 |
|
|
forms acceptable to <STRONG>Tk_GetPixels</STRONG>. The default is 3
|
102 |
|
|
pixels.
|
103 |
|
|
|
104 |
|
|
Name: <STRONG>width</STRONG>
|
105 |
|
|
Class: <STRONG>Width</STRONG>
|
106 |
|
|
Command-Line Switch: <STRONG>-width</STRONG>
|
107 |
|
|
|
108 |
|
|
Specifies the overall width of the paned window in any
|
109 |
|
|
of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. The default
|
110 |
|
|
is 10 pixels.
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
</PRE>
|
114 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
</PRE>
|
119 |
|
|
<H2>DESCRIPTION</H2><PRE>
|
120 |
|
|
The <STRONG>panedwindow</STRONG> command creates a multiple paned window
|
121 |
|
|
widget capable of orienting the panes either vertically or
|
122 |
|
|
horizontally. Each pane is itself a frame acting as a child
|
123 |
|
|
site for other widgets. The border separating each pane
|
124 |
|
|
contains a sash which allows user positioning of the panes
|
125 |
|
|
relative to one another.
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
</PRE>
|
131 |
|
|
<H2>METHODS</H2><PRE>
|
132 |
|
|
The <STRONG>panedwindow</STRONG> command creates a new Tcl command whose name
|
133 |
|
|
is <EM>pathName</EM>. This command may be used to invoke various
|
134 |
|
|
operations on the widget. It has the following general
|
135 |
|
|
form:
|
136 |
|
|
|
137 |
|
|
<EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...?
|
138 |
|
|
|
139 |
|
|
<EM>Option</EM> and the <EM>arg</EM>s determine the exact behavior of the com-
|
140 |
|
|
mand.
|
141 |
|
|
|
142 |
|
|
Many of the widget commands for the <STRONG>panedwindow</STRONG> take as one
|
143 |
|
|
argument an indicator of which pane of the paned window to
|
144 |
|
|
operate on. These indicators are called <EM>indexes</EM> and allow
|
145 |
|
|
reference and manipulation of panes regardless of their
|
146 |
|
|
current map state. Paned window indexes may be specified in
|
147 |
|
|
any of the following forms:
|
148 |
|
|
|
149 |
|
|
<EM>number</EM> Specifies the pane numerically, where 0
|
150 |
|
|
corresponds to the nearest (top/left-most) pane
|
151 |
|
|
of the paned window.
|
152 |
|
|
|
153 |
|
|
<STRONG>end</STRONG> Indicates the farthest (bottom/right-most) pane
|
154 |
|
|
of the paned window.
|
155 |
|
|
|
156 |
|
|
<EM>pattern</EM> If the index doesn't satisfy one of the above
|
157 |
|
|
forms then this form is used. <EM>Pattern</EM> is
|
158 |
|
|
pattern-matched against the tag of each pane in
|
159 |
|
|
the panedwindow, in order from left/top to
|
160 |
|
|
right/left, until a matching entry is found.
|
161 |
|
|
The rules of <STRONG>Tcl_StringMatch</STRONG> are used.
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
</PRE>
|
166 |
|
|
<H2>WIDGET-SPECIFIC METHODS</H2><PRE>
|
167 |
|
|
<EM>pathName</EM> <STRONG>add</STRONG> <EM>tag</EM> ?<EM>option</EM> <EM>value</EM> <EM>option</EM> <EM>value</EM>?
|
168 |
|
|
Adds a new pane to the paned window on the far side
|
169 |
|
|
(right/bottom). The following options may be speci-
|
170 |
|
|
fied:
|
171 |
|
|
|
172 |
|
|
<STRONG>-margin</STRONG> <EM>value</EM>
|
173 |
|
|
Specifies the border distance between the pane and
|
174 |
|
|
pane contents is any of the forms acceptable to
|
175 |
|
|
<STRONG>Tk_GetPixels</STRONG>. The default is 8 pixels.
|
176 |
|
|
|
177 |
|
|
<STRONG>-minimum</STRONG> <EM>value</EM>
|
178 |
|
|
Specifies the minimum size that a pane's contents
|
179 |
|
|
may reach not inclusive of twice the margin in any
|
180 |
|
|
of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. The
|
181 |
|
|
default is 10 pixels.
|
182 |
|
|
|
183 |
|
|
The <STRONG>add</STRONG> method returns the path name of the pane.
|
184 |
|
|
|
185 |
|
|
<EM>pathName</EM> <STRONG>cget</STRONG> <EM>option</EM>
|
186 |
|
|
Returns the current value of the configuration option
|
187 |
|
|
given by <EM>option</EM>. <EM>Option</EM> may have any of the values
|
188 |
|
|
accepted by the <STRONG>panedwindow</STRONG> command.
|
189 |
|
|
|
190 |
|
|
<EM>pathName</EM> <STRONG>childsite</STRONG> ?<EM>index</EM>?
|
191 |
|
|
Returns a list of the child site path names or a
|
192 |
|
|
specific child site given an index. The list is con-
|
193 |
|
|
structed from the near side (left/top) to the far side
|
194 |
|
|
(right/bottom).
|
195 |
|
|
|
196 |
|
|
<EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
197 |
|
|
Query or modify the configuration options of the
|
198 |
|
|
widget. If no <EM>option</EM> is specified, returns a list
|
199 |
|
|
describing all of the available options for <EM>pathName</EM>
|
200 |
|
|
(see <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of
|
201 |
|
|
this list). If <EM>option</EM> is specified with no <EM>value</EM>, then
|
202 |
|
|
the command returns a list describing the one named
|
203 |
|
|
option (this list will be identical to the correspond-
|
204 |
|
|
ing sublist of the value returned if no <EM>option</EM> is
|
205 |
|
|
specified). If one or more <EM>option</EM> - <EM>value</EM> pairs are
|
206 |
|
|
specified, then the command modifies the given widget
|
207 |
|
|
option(s) to have the given value(s); in this case the
|
208 |
|
|
command returns an empty string. <EM>Option</EM> may have any
|
209 |
|
|
of the values accepted by the <STRONG>panedwindow</STRONG> command.
|
210 |
|
|
|
211 |
|
|
<EM>pathName</EM> <STRONG>delete</STRONG> <EM>index</EM>
|
212 |
|
|
Deletes a specified pane given an <EM>index</EM>.
|
213 |
|
|
|
214 |
|
|
<EM>pathName</EM> <STRONG>fraction</STRONG> <EM>percentage</EM> <EM>percentage</EM> ?<EM>percentage</EM> <EM>percentage</EM>
|
215 |
|
|
Sets the visible percentage of the panes. Specifies a
|
216 |
|
|
set of percentages which are applied to the visible
|
217 |
|
|
panes from the near side (left/top). The number of
|
218 |
|
|
percentages must be equal to the current number of
|
219 |
|
|
visible (mapped) panes and add up to 100.
|
220 |
|
|
|
221 |
|
|
<EM>pathName</EM> <STRONG>hide</STRONG> <EM>index</EM>
|
222 |
|
|
Changes the visiblity of the specified pane, allowing a
|
223 |
|
|
previously displayed pane to be visually removed rather
|
224 |
|
|
than deleted.
|
225 |
|
|
|
226 |
|
|
<EM>pathName</EM> <STRONG>index</STRONG> <EM>index</EM>
|
227 |
|
|
Returns the numerical index corresponding to index.
|
228 |
|
|
|
229 |
|
|
<EM>pathName</EM> <STRONG>insert</STRONG> <EM>index</EM> <EM>tag</EM> ?<EM>option</EM> <EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
230 |
|
|
Same as the <STRONG>add</STRONG> command except that it inserts the new
|
231 |
|
|
pane just before the one given by <EM>index</EM>, instead of
|
232 |
|
|
appending to the end of the panedwindow. The <EM>option</EM>,
|
233 |
|
|
and <EM>value</EM> arguments have the same interpretation as for
|
234 |
|
|
the <STRONG>add</STRONG> widget command.
|
235 |
|
|
|
236 |
|
|
<EM>pathName</EM> <STRONG>paneconfigure</STRONG> <EM>index</EM> ?<EM>options</EM>?
|
237 |
|
|
This command is similar to the <STRONG>configure</STRONG> command,
|
238 |
|
|
except that it applies to the options for an individual
|
239 |
|
|
pane, whereas <STRONG>configure</STRONG> applies to the options for the
|
240 |
|
|
paned window as a whole. <EM>Options</EM> may have any of the
|
241 |
|
|
values accepted by the <STRONG>add</STRONG> widget command. If <EM>options</EM>
|
242 |
|
|
are specified, options are modified as indicated in the
|
243 |
|
|
command and the command returns an empty string. If no
|
244 |
|
|
<EM>options</EM> are specified, returns a list describing the
|
245 |
|
|
current options for entry <EM>index</EM> (see <STRONG>Tk_ConfigureInfo</STRONG>
|
246 |
|
|
for information on the format of this list).
|
247 |
|
|
|
248 |
|
|
<EM>pathName</EM> <STRONG>reset</STRONG>
|
249 |
|
|
Redisplays the pane window using default percentages.
|
250 |
|
|
|
251 |
|
|
<EM>pathName</EM> <STRONG>show</STRONG> <EM>index</EM>
|
252 |
|
|
Changes the visiblity of the specified pane, allowing a
|
253 |
|
|
previously hidden pane to be displayed.
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
|
257 |
|
|
</PRE>
|
258 |
|
|
<H2>NOTES</H2><PRE>
|
259 |
|
|
Dynamic changing of the margin and or minimum options
|
260 |
|
|
to values which make the current configuration invalid
|
261 |
|
|
will block subsequent sash movement until the fractions
|
262 |
|
|
are modified via the fraction method. For example a
|
263 |
|
|
panedwindow is created with three panes and the minimum
|
264 |
|
|
and margin options are at their default settings. Next
|
265 |
|
|
the user moves the sashes to compact the panes to one
|
266 |
|
|
side. Now, if the minimum is increased on the most
|
267 |
|
|
compressed pane via the paneconfigure method to a large
|
268 |
|
|
enough value, then sash movement is blocked until the
|
269 |
|
|
fractions are adjusted. This situation is unusual and
|
270 |
|
|
under normal operation of the panedwindow, this problem
|
271 |
|
|
will never occur.
|
272 |
|
|
|
273 |
|
|
|
274 |
|
|
</PRE>
|
275 |
|
|
<H2>EXAMPLE</H2><PRE>
|
276 |
|
|
panedwindow .pw -width 300 -height 300
|
277 |
|
|
.pw add top
|
278 |
|
|
.pw add middle -margin 10
|
279 |
|
|
.pw add bottom -margin 10 -minimum 10
|
280 |
|
|
|
281 |
|
|
pack .pw -fill both -expand yes
|
282 |
|
|
|
283 |
|
|
foreach pane [.pw childSite] {
|
284 |
|
|
button $pane.b -text $pane -relief raised -borderwidth 2
|
285 |
|
|
pack $pane.b -fill both -expand yes
|
286 |
|
|
}
|
287 |
|
|
|
288 |
|
|
.pw fraction 50 30 20
|
289 |
|
|
.pw paneconfigure 0 -minimum 20
|
290 |
|
|
.pw paneconfigure bottom -margin 15
|
291 |
|
|
|
292 |
|
|
|
293 |
|
|
|
294 |
|
|
</PRE>
|
295 |
|
|
<H2>ACKNOWLEDGEMENTS:</H2><PRE>
|
296 |
|
|
Jay Schmidgall
|
297 |
|
|
|
298 |
|
|
1994 - Base logic posted to comp.lang.tcl
|
299 |
|
|
|
300 |
|
|
Joe Hidebrand <hildjj@fuentez.com>
|
301 |
|
|
|
302 |
|
|
07/25/94 - Posted first multipane version to
|
303 |
|
|
comp.lang.tcl
|
304 |
|
|
|
305 |
|
|
07/28/94 - Added support for vertical panes
|
306 |
|
|
|
307 |
|
|
Ken Copeland <ken@hilco.com>
|
308 |
|
|
|
309 |
|
|
09/28/95 - Smoothed out the sash movement and added
|
310 |
|
|
squeezable panes.
|
311 |
|
|
|
312 |
|
|
|
313 |
|
|
</PRE>
|
314 |
|
|
<H2>AUTHOR</H2><PRE>
|
315 |
|
|
Mark L. Ulferts
|
316 |
|
|
|
317 |
|
|
|
318 |
|
|
</PRE>
|
319 |
|
|
<H2>KEYWORDS</H2><PRE>
|
320 |
|
|
panedwindow, widget
|
321 |
|
|
|
322 |
|
|
|
323 |
|
|
|
324 |
|
|
|
325 |
|
|
|
326 |
|
|
|
327 |
|
|
|
328 |
|
|
|
329 |
|
|
|
330 |
|
|
|
331 |
|
|
|
332 |
|
|
|
333 |
|
|
|
334 |
|
|
|
335 |
|
|
|
336 |
|
|
|
337 |
|
|
|
338 |
|
|
|
339 |
|
|
|
340 |
|
|
|
341 |
|
|
|
342 |
|
|
|
343 |
|
|
|
344 |
|
|
|
345 |
|
|
|
346 |
|
|
|
347 |
|
|
|
348 |
|
|
|
349 |
|
|
|
350 |
|
|
|
351 |
|
|
</PRE>
|
352 |
|
|
</BODY>
|
353 |
|
|
</HTML>
|