Debian Codegraph @

pod/Panedwindow.pod

raw
1 # Copyright (c) 1992 The Regents of the University of California.
2 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
3 # See the file "license.terms" for information on usage and redistribution
4 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5 # RCS: @(#) $Id: panedwindow.n,v 1.2.2.1 2003/07/17 20:49:00 dkf Exp $
6
7 =head1 NAME
8
9 Tk::Panedwindow - Create and manipulate Panedwindow widgets
10
11 =for category Tk Generic Methods
12
13 =head1 SYNOPSIS
14
15 I<$panedwindow> = I<$parent>-E<gt>B<Panedwindow>(?I<options>?);
16
17 -background -height -width
18 -borderwidth -orient
19 -cursor -relief
20
21 =head1 WIDGET-SPECIFIC OPTIONS
22
23 =over 4
24
25 =item Option: B<-handlepad>
26
27 =item Name: B<handlePad>
28
29 =item Class: B<HandlePad>
30
31 When sash handles are drawn, specifies the distance from the top or
32 left end of the sash (depending on the orientation of the widget) at
33 which to draw the handle. May be any value accepted by B<Tk_GetPixels>.
34
35 =item Option: B<-handlesize>
36
37 =item Name: B<handleSize>
38
39 =item Class: B<HandleSize>
40
41 Specifies the side length of a sash handle. Handles are always
42 drawn as squares. May be any value accepted by B<Tk_GetPixels>.
43
44 =item Option: B<-opaqueresize>
45
46 =item Name: B<opaqueResize>
47
48 =item Class: B<OpaqueResize>
49
50 Specifies whether panes should be resized as a sash is moved (true),
51 or if resizing should be deferred until the sash is placed (false).
52
53 =item Option: B<-sashcursor>
54
55 =item Name: B<sashCursor>
56
57 =item Class: B<SashCursor>
58
59 Mouse cursor to use when over a sash. If null,
60 B<sb_h_double_arrow> will be used for horizontal Panedwindows, and
61 B<sb_v_double_arrow> will be used for vertical Panedwindows.
62
63 =item Option: B<-sashpad>
64
65 =item Name: B<sashPad>
66
67 =item Class: B<SashPad>
68
69 Specifies the amount of padding to leave of each side of a sash. May
70 be any value accepted by B<Tk_GetPixels>.
71
72 =item Option: B<-sashrelief>
73
74 =item Name: B<sashRelief>
75
76 =item Class: B<SashRelief>
77
78 Relief to use when drawing a sash. May be any of the standard Tk
79 relief values.
80
81 =item Option: B<-sashwidth>
82
83 =item Name: B<sashWidth>
84
85 =item Class: B<SashWidth>
86
87 Specifies the width of each sash. May be any value accepted by
88 B<Tk_GetPixels>.
89
90 =item Option: B<-showhandle>
91
92 =item Name: B<showHandle>
93
94 =item Class: B<ShowHandle>
95
96 Specifies whether sash handles should be shown. May be any valid
97 boolean value.
98
99 =back
100
101 =head1 DESCRIPTION
102
103 The B<Panedwindow> method creates a new window (given by the
104 $panedwindow argument) and makes it into a Panedwindow widget.
105 Additional options, described above, may be specified on the command
106 line or in the option database to configure aspects of the Panedwindow
107 such as its default background color and relief.
108
109 A Panedwindow widget contains any number of panes, arranged
110 horizontally or vertically, according to the value of the
111 B<-orient> option. Each pane contains one widget, and each pair of
112 panes is separated by a moveable (via mouse movements) sash. Moving a
113 sash causes the widgets on either side of the sash to be resized.
114
115 =head1 WIDGET METHODS
116
117 The B<Panedwindow> method
118 may be used to invoke various operations on the widget. It has the
119 following general form:
120
121 $widget->method(?arg arg ...?);
122
123 The following
124 commands are possible for Panedwindow widgets:
125
126 =over 4
127
128 =item I<$widget>-E<gt>B<add>(?window ...? ?option value ...?);
129
130 Add one or more windows to the Panedwindow, each in a separate pane.
131 The arguments consist of the names of one or more windows
132 followed by pairs of arguments that specify how to manage the windows.
133 I<Option> may have any of the values accepted by the
134 B<configure> subcommand.
135
136 =item I<$widget>-E<gt>B<cget>(I<option>);
137
138 Returns the current value of the configuration option given by
139 I<option>. I<Option> may have any of the values accepted by the
140 B<Panedwindow> command.
141
142 =item I<$widget>-E<gt>B<configure>(I<?option?, ?value, option, value, ...?>);
143
144 Query or modify the configuration options of the widget. If no
145 I<option> is specified, returns a list describing all of the
146 available options for $widget (see L<Tk::configure> for
147 information on the format of this list). If I<option> is specified
148 with no I<value>, then the command returns a list describing the
149 one named option (this list will be identical to the corresponding
150 sublist of the value returned if no I<option> is specified). If
151 one or more I<option-value> pairs are specified, then the command
152 modifies the given widget option(s) to have the given value(s); in
153 this case the command returns an empty string. I<Option> may have
154 any of the values accepted by the B<Panedwindow> command.
155
156 =item I<$widget>-E<gt>B<forget>(?window ...?);
157
158 Remove the pane containing $widget from the Panedwindow. All
159 geometry management options for $widget will be forgotten.
160
161 =item I<$widget>-E<gt>B<identify>(I<x, y>);
162
163 Identify the Panedwindow component underneath the point given by
164 I<x> and I<y>, in window coordinates. If the point is over a
165 sash or a sash handle, the result is a two element list containing the
166 index of the sash or handle, and a word indicating whether it is over
167 a sash or a handle, such as [0, 'sash'] or [2, 'handle']. If the point is
168 over any other part of the Panedwindow, the result is an empty list.
169
170 =item I<$widget>-E<gt>B<proxy>(I<?args?>);
171
172 This command is used to query and change the position of the sash
173 proxy, used for rubberband-style pane resizing. It can take any of
174 the following forms:
175
176 =over 4
177
178 =item I<$widget>-E<gt>B<proxyCoord>;
179
180 Return a list containing the x and y coordinates of the most recent
181 proxy location.
182
183 =item I<$widget>-E<gt>B<proxyForget>;
184
185 Remove the proxy from the display.
186
187 =item I<$widget>-E<gt>B<proxyPlace>(I<x, y>);
188
189 Place the proxy at the given I<x> and I<y> coordinates.
190
191 =back
192
193 =item I<$widget>-E<gt>B<sash>(I<?args?>);
194
195 This command is used to query and change the position of sashes in the
196 Panedwindow. It can take any of the following forms:
197
198 =over 4
199
200 =item I<$widget>-E<gt>B<sashCoord>(I<index>);
201
202 Return the current x and y coordinate pair for the sash given by
203 I<index>. I<Index> must be an integer between 0 and 1 less than
204 the number of panes in the Panedwindow. The coordinates given are
205 those of the top left corner of the region containing the sash.
206 I<$widget>-E<gt>B<sashDragto>(I<index, x, y>)
207 This command computes the difference between the given coordinates and the
208 coordinates given to the last B<sash coord> command for the given
209 sash. It then moves that sash the computed difference. The return
210 value is the empty string.
211
212 =item I<$widget>-E<gt>B<sashMark>(I<index, x, y>);
213
214 Records I<x> and I<y> for the sash given by I<index>; used in
215 conjunction with later dragto commands to move the sash.
216
217 =item I<$widget>-E<gt>B<sashPlace>(I<index, x, y>);
218
219 Place the sash given by I<index> at the given coordinates.
220
221 =back
222
223 =item $widget I<$widget>-E<gt>B<panecget>(option);
224
225 Query a management option for $widget. I<Option> may be any
226 value allowed by the B<paneconfigure> subcommand.
227
228 =item $widget I<$widget>-E<gt>B<paneconfigure>(?option? ?value option value ...?);
229
230 Query or modify the management options for $widget. If no
231 I<option> is specified, returns a list describing all of the
232 available options for $widget (see L<Tk::configure> for
233 information on the format of this list). If I<option> is specified
234 with no I<value>, then the command returns a list describing the
235 one named option (this list will be identical to the corresponding
236 sublist of the value returned if no I<option> is specified). If
237 one or more I<option-value> pairs are specified, then the command
238 modifies the given widget option(s) to have the given value(s); in
239 this case the command returns an empty string. The following options
240 are supported:
241
242 =over 4
243
244 =item B<-after> =E<gt> $widget
245
246 Insert the window after the window specified. $widget should be the
247 name of a window already managed by $widget.
248
249 =item B<-before> =E<gt> $widget
250
251 Insert the window before the window specified. $widget should be
252 the name of a window already managed by $widget.
253
254 =item B<-height> =E<gt> I<size>
255
256 Specify a height for the window. The height will be the outer
257 dimension of the window including its border, if any. If I<size>
258 is an empty string, or if B<-height> is not specified, then the
259 height requested internally by the window will be used initially; the
260 height may later be adjusted by the movement of sashes in the
261 Panedwindow. I<Size> may be any value accepted by B<Tk_GetPixels>.
262
263 =item B<-minsize> =E<gt> I<n>
264
265 Specifies that the size of the window cannot be made less than
266 I<n>. This constraint only affects the size of the widget in the
267 paned dimension -- the x dimension for horizontal Panedwindows, the y
268 dimension for vertical Panedwindows. May be any value accepted by
269 B<Tk_GetPixels>.
270
271 =item B<-padx> =E<gt> I<n>
272
273 Specifies a non-negative value indicating how much extra space to
274 leave on each side of the window in the X-direction. The value may
275 have any of the forms accepted by B<Tk_GetPixels>.
276
277 =item B<-pady> =E<gt> I<n>
278
279 Specifies a non-negative value indicating how much extra space to
280 leave on each side of the window in the Y-direction. The value may
281 have any of the forms accepted by B<Tk_GetPixels>.
282
283 =item B<-sticky> =E<gt> I<style>
284
285 If a window's pane is larger than the requested dimensions of the
286 window, this option may be used to position (or stretch) the window
287 within its pane. I<Style> is a string that contains zero or more
288 of the characters B<n>, B<s>, B<e> or B<w>. The string
289 can optionally contains spaces or commas, but they are ignored. Each
290 letter refers to a side (north, south, east, or west) that the window
291 will "stick" to. If both B<n> and B<s> (or B<e> and B<w>)
292 are specified, the window will be stretched to fill the entire height
293 (or width) of its cavity.
294
295 =item B<-width> =E<gt> I<size>
296
297 Specify a width for the window. The width will be the outer
298 dimension of the window including its border, if any. If I<size>
299 is an empty string, or if B<-width> is not specified, then the
300 width requested internally by the window will be used initially; the
301 width may later be adjusted by the movement of sashes in the
302 Panedwindow. I<Size> may be any value accepted by B<Tk_GetPixels>.
303
304 =back
305
306 =item I<$widget>-E<gt>B<panes>;
307
308 Returns an ordered list of the widgets managed by $widget.
309
310 =back
311
312 =head1 RESIZING PANES
313
314 A pane is resized by grabbing the sash (or sash handle if present) and
315 dragging with the mouse. This is accomplished via mouse motion
316 bindings on the widget. When a sash is moved, the sizes of the panes
317 on each side of the sash, and thus the widgets in those panes, are
318 adjusted.
319
320 When a pane is resized from outside (eg, it is packed to expand and
321 fill, and the containing toplevel is resized), space is added to the final
322 (rightmost or bottommost) pane in the window.
323
324 =head1 KEYWORDS
325
326 Panedwindow, widget, geometry management