1panedwindow(n) Tk Built-In Commands panedwindow(n)
2
3
4
5______________________________________________________________________________
6
8 panedwindow - Create and manipulate 'panedwindow' split container wid‐
9 gets
10
12 panedwindow pathName ?options?
13
15 -background -borderwidth -cursor
16 -orient -relief
17
18 See the options manual entry for details on the standard options.
19
21 Command-Line Name:-handlepad
22 Database Name: handlePad
23 Database Class: HandlePad
24
25 When sash handles are drawn, specifies the distance from the top
26 or left end of the sash (depending on the orientation of the
27 widget) at which to draw the handle. May be any value accepted
28 by Tk_GetPixels.
29
30 Command-Line Name:-handlesize
31 Database Name: handleSize
32 Database Class: HandleSize
33
34 Specifies the side length of a sash handle. Handles are always
35 drawn as squares. May be any value accepted by Tk_GetPixels.
36
37 Command-Line Name:-height
38 Database Name: height
39 Database Class: Height
40
41 Specifies a desired height for the overall panedwindow widget.
42 May be any value accepted by Tk_GetPixels. If an empty string,
43 the widget will be made high enough to allow all contained wid‐
44 gets to have their natural height.
45
46 Command-Line Name:-opaqueresize
47 Database Name: opaqueResize
48 Database Class: OpaqueResize
49
50 Specifies whether panes should be resized as a sash is moved
51 (true), or if resizing should be deferred until the sash is
52 placed (false). In the latter case, a “ghost” version of the
53 sash is displayed during the resizing to show where the panes
54 will be resized to when releasing the mouse button. This “ghost”
55 version of the sash is the proxy. It's rendering can be config‐
56 ured using the -proxybackground, -proxyborderwidth and -proxyre‐
57 lief options.
58
59 Command-Line Name:-proxybackground
60 Database Name: proxyBackground
61 Database Class: ProxyBackground
62
63 Background color to use when drawing the proxy. If an empty
64 string, the value of the -background option will be used.
65
66 Command-Line Name:-proxyborderwidth
67 Database Name: proxyBorderWidth
68 Database Class: ProxyBorderWidth
69
70 Specifies the borderwidth of the proxy. May be any value ac‐
71 cepted by Tk_GetPixels.
72
73 Command-Line Name:-proxyrelief
74 Database Name: proxyRelief
75 Database Class: ProxyRelief
76
77 Relief to use when drawing the proxy. May be any of the standard
78 Tk relief values. If an empty string, the value of the -sashre‐
79 lief option will be used.
80
81 Command-Line Name:-sashcursor
82 Database Name: sashCursor
83 Database Class: SashCursor
84
85 Mouse cursor to use when over a sash. If null, sb_h_double_ar‐
86 row will be used for horizontal panedwindows, and sb_v_dou‐
87 ble_arrow will be used for vertical panedwindows.
88
89 Command-Line Name:-sashpad
90 Database Name: sashPad
91 Database Class: SashPad
92
93 Specifies the amount of padding to leave of each side of a sash.
94 May be any value accepted by Tk_GetPixels.
95
96 Command-Line Name:-sashrelief
97 Database Name: sashRelief
98 Database Class: SashRelief
99
100 Relief to use when drawing a sash. May be any of the standard
101 Tk relief values.
102
103 Command-Line Name:-sashwidth
104 Database Name: sashWidth
105 Database Class: SashWidth
106
107 Specifies the width of each sash. May be any value accepted by
108 Tk_GetPixels.
109
110 Command-Line Name:-showhandle
111 Database Name: showHandle
112 Database Class: ShowHandle
113
114 Specifies whether sash handles should be shown. May be any
115 valid Tcl boolean value.
116
117 Command-Line Name:-width
118 Database Name: width
119 Database Class: Width
120
121 Specifies a desired width for the overall panedwindow widget.
122 May be any value accepted by Tk_GetPixels. If an empty string,
123 the widget will be made wide enough to allow all contained wid‐
124 gets to have their natural width.
125______________________________________________________________________________
126
128 The panedwindow command creates a new window (given by the pathName ar‐
129 gument) and makes it into a panedwindow widget. Additional options,
130 described above, may be specified on the command line or in the option
131 database to configure aspects of the panedwindow such as its default
132 background color and relief. The panedwindow command returns the path
133 name of the new window.
134
135 A panedwindow widget contains any number of panes, arranged horizon‐
136 tally or vertically, according to the value of the -orient option.
137 Each pane contains one widget, and each pair of panes is separated by a
138 moveable (via mouse movements) sash. Moving a sash causes the widgets
139 on either side of the sash to be resized.
140
142 The panedwindow command creates a new Tcl command whose name is the
143 same as the path name of the panedwindow's window. This command may be
144 used to invoke various operations on the widget. It has the following
145 general form:
146 pathName option ?arg arg ...?
147 PathName is the name of the command, which is the same as the panedwin‐
148 dow widget's path name. Option and the args determine the exact behav‐
149 ior of the command. The following commands are possible for panedwin‐
150 dow widgets:
151
152 pathName add window ?window ...? ?option value ...?
153 Add one or more windows to the panedwindow, each in a separate
154 pane. The arguments consist of the names of one or more windows
155 followed by pairs of arguments that specify how to manage the
156 windows. Option may have any of the values accepted by the con‐
157 figure subcommand.
158
159 pathName cget option
160 Returns the current value of the configuration option given by
161 option. Option may have any of the values accepted by the
162 panedwindow command.
163
164 pathName configure ?option? ?value option value ...?
165 Query or modify the configuration options of the widget. If no
166 option is specified, returns a list describing all of the avail‐
167 able options for pathName (see Tk_ConfigureInfo for information
168 on the format of this list). If option is specified with no
169 value, then the command returns a list describing the one named
170 option (this list will be identical to the corresponding sublist
171 of the value returned if no option is specified). If one or
172 more option-value pairs are specified, then the command modifies
173 the given widget option(s) to have the given value(s); in this
174 case the command returns an empty string. Option may have any of
175 the values accepted by the panedwindow command.
176
177 pathName forget window ?window ...?
178 Remove the pane containing window from the panedwindow. All ge‐
179 ometry management options for window will be forgotten.
180
181 pathName identify x y
182 Identify the panedwindow component underneath the point given by
183 x and y, in window coordinates. If the point is over a sash or
184 a sash handle, the result is a two element list containing the
185 index of the sash or handle, and a word indicating whether it is
186 over a sash or a handle, such as {0 sash} or {2 handle}. If the
187 point is over any other part of the panedwindow, the result is
188 an empty list.
189
190 pathName panecget window option
191 Query a management option for window. Option may be any value
192 allowed by the paneconfigure subcommand.
193
194 pathName paneconfigure window ?option? ?value option value ...?
195 Query or modify the management options for window. If no option
196 is specified, returns a list describing all of the available op‐
197 tions for pathName (see Tk_ConfigureInfo for information on the
198 format of this list). If option is specified with no value,
199 then the command returns a list describing the one named option
200 (this list will be identical to the corresponding sublist of the
201 value returned if no option is specified). If one or more op‐
202 tion-value pairs are specified, then the command modifies the
203 given widget option(s) to have the given value(s); in this case
204 the command returns an empty string. The following options are
205 supported:
206
207 -after window
208 Insert the window after the window specified. window
209 should be the name of a window already managed by path‐
210 Name.
211
212 -before window
213 Insert the window before the window specified. window
214 should be the name of a window already managed by path‐
215 Name.
216
217 -height size
218 Specify a height for the window. The height will be the
219 outer dimension of the window including its border, if
220 any. If size is an empty string, or if -height is not
221 specified, then the height requested internally by the
222 window will be used initially; the height may later be
223 adjusted by the movement of sashes in the panedwindow.
224 Size may be any value accepted by Tk_GetPixels.
225
226 -hide boolean
227 Controls the visibility of a pane. When the boolean is
228 true (according to Tcl_GetBoolean) the pane will not be
229 visible, but it will still be maintained in the list of
230 panes.
231
232 -minsize n
233 Specifies that the size of the window cannot be made less
234 than n. This constraint only affects the size of the
235 widget in the paned dimension — the x dimension for hori‐
236 zontal panedwindows, the y dimension for vertical paned‐
237 windows. May be any value accepted by Tk_GetPixels.
238
239 -padx n
240 Specifies a non-negative value indicating how much extra
241 space to leave on each side of the window in the X-direc‐
242 tion. The value may have any of the forms accepted by
243 Tk_GetPixels.
244
245 -pady n
246 Specifies a non-negative value indicating how much extra
247 space to leave on each side of the window in the Y-direc‐
248 tion. The value may have any of the forms accepted by
249 Tk_GetPixels.
250
251 -sticky style
252 If a window's pane is larger than the requested dimen‐
253 sions of the window, this option may be used to position
254 (or stretch) the window within its pane. Style is a
255 string that contains zero or more of the characters n, s,
256 e or w. The string can optionally contains spaces or
257 commas, but they are ignored. Each letter refers to a
258 side (north, south, east, or west) that the window will
259 “stick” to. If both n and s (or e and w) are specified,
260 the window will be stretched to fill the entire height
261 (or width) of its cavity.
262
263 -stretch when
264 Controls how extra space is allocated to each of the
265 panes. When is one of always, first, last, middle, and
266 never. The panedwindow will calculate the required size
267 of all its panes. Any remaining (or deficit) space will
268 be distributed to those panes marked for stretching. The
269 space will be distributed based on each panes current ra‐
270 tio of the whole. The when values have the following
271 definition:
272
273 always This pane will always stretch.
274
275 first Only if this pane is the first pane (left-most or
276 top-most) will it stretch.
277
278 last Only if this pane is the last pane (right-most or
279 bottom-most) will it stretch. This is the default
280 value.
281
282 middle Only if this pane is not the first or last pane
283 will it stretch.
284
285 never This pane will never stretch.
286
287 -width size
288 Specify a width for the window. The width will be the
289 outer dimension of the window including its border, if
290 any. If size is an empty string, or if -width is not
291 specified, then the width requested internally by the
292 window will be used initially; the width may later be ad‐
293 justed by the movement of sashes in the panedwindow.
294 Size may be any value accepted by Tk_GetPixels.
295
296 pathName panes
297 Returns an ordered list of the widgets managed by pathName.
298
299 pathName proxy ?args?
300 This command is used to query and change the position of the
301 sash proxy, used for rubberband-style pane resizing. It can take
302 any of the following forms:
303
304 pathName proxy coord
305 Return a list containing the x and y coordinates of the
306 most recent proxy location.
307
308 pathName proxy forget
309 Remove the proxy from the display.
310
311 pathName proxy place x y
312 Place the proxy at the given x and y coordinates.
313
314 pathName sash ?args?
315 This command is used to query and change the position of sashes
316 in the panedwindow. It can take any of the following forms:
317
318 pathName sash coord index
319 Return the current x and y coordinate pair for the sash
320 given by index. Index must be an integer between 0 and 1
321 less than the number of panes in the panedwindow. The
322 coordinates given are those of the top left corner of the
323 region containing the sash.
324
325 pathName sash dragto index x y
326 This command computes the difference between the given
327 coordinates and the coordinates given to the last sash
328 mark command for the given sash. It then moves that sash
329 the computed difference. The return value is the empty
330 string.
331
332 pathName sash mark index x y
333 Records x and y for the sash given by index; used in con‐
334 junction with later sash dragto commands to move the
335 sash.
336
337 pathName sash place index x y
338 Place the sash given by index at the given coordinates.
339
341 A pane is resized by grabbing the sash (or sash handle if present) and
342 dragging with the mouse. This is accomplished via mouse motion bind‐
343 ings on the widget. When a sash is moved, the sizes of the panes on
344 each side of the sash, and thus the widgets in those panes, are ad‐
345 justed.
346
347 When a pane is resized from outside (e.g. it is packed to expand and
348 fill, and the containing toplevel is resized), space is added to the
349 final (rightmost or bottommost) pane in the window.
350
351 Unlike child windows managed by e.g. pack or grid, the panes managed by
352 a panedwindow do not change width or height to accommodate changes in
353 the requested widths or heights of the panes, once these have become
354 mapped. Therefore it may be advisable, particularly when creating lay‐
355 outs interactively, to not add a pane to the panedwindow widget until
356 after the geometry requests of that pane has been finalized (i.e., all
357 components of the pane inserted, all options affecting geometry set to
358 their proper values, etc.).
359
361 ttk::panedwindow(n)
362
364 panedwindow, widget, geometry management
365
366
367
368Tk 8.4 panedwindow(n)