1# This file is a Tcl script to test entry widgets in Tk.  It is
2# organized in the standard fashion for Tcl tests.
3#
4# Copyright (c) 1994 The Regents of the University of California.
5# Copyright (c) 1994-1997 Sun Microsystems, Inc.
6# Copyright (c) 1998-1999 by Scriptics Corporation.
7# All rights reserved.
8
9package require tcltest 2.2
10eval tcltest::configure $argv
11tcltest::loadTestedCommands
12namespace import -force tcltest::test
13
14deleteWindows
15# Panedwindow for tests 1.*
16panedwindow .p
17# Buttons for tests 1.33 - 1.52
18.p add [button .b]
19.p add [button .c]
20test panedwindow-1.1 {configuration options: -background (good)} -body {
21    .p configure -background #ff0000
22    list [lindex [.p configure -background] 4] [.p cget -background]
23} -cleanup {
24    .p configure -background [lindex [.p configure -background] 3]
25} -result {{#ff0000} #ff0000}
26test panedwindow-1.2 {configuration options: -background (bad)} -body {
27    .p configure -background non-existent
28} -returnCodes error -result {unknown color name "non-existent"}
29test panedwindow-1.3 {configuration options: -bd (good)} -body {
30    .p configure -bd 4
31    list [lindex [.p configure -bd] 4] [.p cget -bd]
32} -cleanup {
33    .p configure -bd [lindex [.p configure -bd] 3]
34} -result {4 4}
35test panedwindow-1.4 {configuration options: -bd (bad)} -body {
36    .p configure -bd badValue
37} -returnCodes error -result {bad screen distance "badValue"}
38test panedwindow-1.5 {configuration options: -bg (good)} -body {
39    .p configure -bg #ff0000
40    list [lindex [.p configure -bg] 4] [.p cget -bg]
41} -cleanup {
42    .p configure -bg [lindex [.p configure -bg] 3]
43} -result {{#ff0000} #ff0000}
44test panedwindow-1.6 {configuration options: -bg (bad)} -body {
45    .p configure -bg non-existent
46} -returnCodes error -result {unknown color name "non-existent"}
47test panedwindow-1.7 {configuration options: -borderwidth (good)} -body {
48    .p configure -borderwidth 1.3
49    list [lindex [.p configure -borderwidth] 4] [.p cget -borderwidth]
50} -cleanup {
51    .p configure -borderwidth [lindex [.p configure -borderwidth] 3]
52} -result {1 1}
53test panedwindow-1.8 {configuration options: -borderwidth (bad)} -body {
54    .p configure -borderwidth badValue
55} -returnCodes error -result {bad screen distance "badValue"}
56test panedwindow-1.9 {configuration options: -cursor (good)} -body {
57    .p configure -cursor arrow
58    list [lindex [.p configure -cursor] 4] [.p cget -cursor]
59} -cleanup {
60    .p configure -cursor [lindex [.p configure -cursor] 3]
61} -result {arrow arrow}
62test panedwindow-1.10 {configuration options: -cursor (bad)} -body {
63    .p configure -cursor badValue
64} -returnCodes error -result {bad cursor spec "badValue"}
65test panedwindow-1.11 {configuration options: -handlesize (good)} -body {
66    .p configure -handlesize 20
67    list [lindex [.p configure -handlesize] 4] [.p cget -handlesize]
68} -cleanup {
69    .p configure -handlesize [lindex [.p configure -handlesize] 3]
70} -result {20 20}
71test panedwindow-1.12 {configuration options: -handlesize (bad)} -body {
72    .p configure -handlesize badValue
73} -returnCodes error -result {bad screen distance "badValue"}
74test panedwindow-1.13 {configuration options: -height (good)} -body {
75    .p configure -height 20
76    list [lindex [.p configure -height] 4] [.p cget -height]
77} -cleanup {
78    .p configure -height [lindex [.p configure -height] 3]
79} -result {20 20}
80test panedwindow-1.14 {configuration options: -height (bad)} -body {
81    .p configure -height badValue
82} -returnCodes error -result {bad screen distance "badValue"}
83test panedwindow-1.15 {configuration options: -opaqueresize (good)} -body {
84    .p configure -opaqueresize true
85    list [lindex [.p configure -opaqueresize] 4] [.p cget -opaqueresize]
86} -cleanup {
87    .p configure -opaqueresize [lindex [.p configure -opaqueresize] 3]
88} -result {1 1}
89test panedwindow-1.16 {configuration options: -opaqueresize (bad)} -body {
90    .p configure -opaqueresize foo
91} -returnCodes error -result {expected boolean value but got "foo"}
92test panedwindow-1.17 {configuration options: -orient (good)} -body {
93    .p configure -orient horizontal
94    list [lindex [.p configure -orient] 4] [.p cget -orient]
95} -cleanup {
96    .p configure -orient [lindex [.p configure -orient] 3]
97} -result {horizontal horizontal}
98test panedwindow-1.18 {configuration options: -orient (bad)} -body {
99    .p configure -orient badValue
100} -returnCodes error -result {bad orient "badValue": must be horizontal or vertical}
101test panedwindow-1.19 {configuration options: -proxybackground (good)} -body {
102    .p configure -proxybackground "#f0a0a0"
103    list [lindex [.p configure -proxybackground] 4] [.p cget -proxybackground]
104} -cleanup {
105    .p configure -proxybackground [lindex [.p configure -proxybackground] 3]
106} -result {{#f0a0a0} #f0a0a0}
107test panedwindow-1.20 {configuration options: -proxybackground (bad)} -body {
108    .p configure -proxybackground badValue
109} -returnCodes error -result {unknown color name "badValue"}
110test panedwindow-1.21 {configuration options: -proxyborderwidth (good)} -body {
111    .p configure -proxyborderwidth 1.3
112    list [lindex [.p configure -proxyborderwidth] 4] [.p cget -proxyborderwidth]
113} -cleanup {
114    .p configure -proxyborderwidth [lindex [.p configure -proxyborderwidth] 3]
115} -result {1.3 1.3}
116test panedwindow-1.22 {configuration options: -proxyborderwidth (bad)} -body {
117    .p configure -proxyborderwidth badValue
118} -returnCodes error -result {bad screen distance "badValue"}
119test panedwindow-1.23 {configuration options: -proxyrelief (good)} -body {
120    .p configure -proxyrelief groove
121    list [lindex [.p configure -proxyrelief] 4] [.p cget -proxyrelief]
122} -cleanup {
123    .p configure -proxyrelief [lindex [.p configure -proxyrelief] 3]
124} -result {groove groove}
125test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -body {
126    .p configure -proxyrelief 1.5
127} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
128test panedwindow-1.25 {configuration options: -relief (good)} -body {
129    .p configure -relief groove
130    list [lindex [.p configure -relief] 4] [.p cget -relief]
131} -cleanup {
132    .p configure -relief [lindex [.p configure -relief] 3]
133} -result {groove groove}
134test panedwindow-1.26 {configuration options: -relief (bad)} -body {
135    .p configure -relief 1.5
136} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
137test panedwindow-1.27 {configuration options: -sashcursor (good)} -body {
138    .p configure -sashcursor arrow
139    list [lindex [.p configure -sashcursor] 4] [.p cget -sashcursor]
140} -cleanup {
141    .p configure -sashcursor [lindex [.p configure -sashcursor] 3]
142} -result {arrow arrow}
143test panedwindow-1.28 {configuration options: -sashcursor (bad)} -body {
144    .p configure -sashcursor badValue
145} -returnCodes error -result {bad cursor spec "badValue"}
146test panedwindow-1.29 {configuration options: -sashpad (good)} -body {
147    .p configure -sashpad 1.3
148    list [lindex [.p configure -sashpad] 4] [.p cget -sashpad]
149} -cleanup {
150    .p configure -sashpad [lindex [.p configure -sashpad] 3]
151} -result {1 1}
152test panedwindow-1.30 {configuration options: -sashpad (bad)} -body {
153    .p configure -sashpad badValue
154} -returnCodes error -result {bad screen distance "badValue"}
155test panedwindow-1.31 {configuration options: -sashrelief (good)} -body {
156    .p configure -sashrelief groove
157    list [lindex [.p configure -sashrelief] 4] [.p cget -sashrelief]
158} -cleanup {
159    .p configure -sashrelief [lindex [.p configure -sashrelief] 3]
160} -result {groove groove}
161test panedwindow-1.32 {configuration options: -sashrelief (bad)} -body {
162    .p configure -sashrelief 1.5
163} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
164test panedwindow-1.33 {configuration options: -sashwidth (good)} -body {
165    .p configure -sashwidth 10
166    list [lindex [.p configure -sashwidth] 4] [.p cget -sashwidth]
167} -cleanup {
168    .p configure -sashwidth [lindex [.p configure -sashwidth] 3]
169} -result {10 10}
170test panedwindow-1.34 {configuration options: -sashwidth (bad)} -body {
171    .p configure -sashwidth badValue
172} -returnCodes error -result {bad screen distance "badValue"}
173test panedwindow-1.35 {configuration options: -showhandle (good)} -body {
174    .p configure -showhandle true
175    list [lindex [.p configure -showhandle] 4] [.p cget -showhandle]
176} -cleanup {
177    .p configure -showhandle [lindex [.p configure -showhandle] 3]
178} -result {1 1}
179test panedwindow-1.36 {configuration options: -showhandle (bad)} -body {
180    .p configure -showhandle foo
181} -returnCodes error -result {expected boolean value but got "foo"}
182test panedwindow-1.37 {configuration options: -width (good)} -body {
183    .p configure -width 402
184    list [lindex [.p configure -width] 4] [.p cget -width]
185} -cleanup {
186    .p configure -width [lindex [.p configure -width] 3]
187} -result {402 402}
188test panedwindow-1.38 {configuration options: -width (bad)} -body {
189    .p configure -width badValue
190} -returnCodes error -result {bad screen distance "badValue"}
191
192test panedwindow-1.39 {configuration options: -after (good)} -body {
193    .p paneconfigure .b -after .c
194    list [lindex [.p paneconfigure .b -after] 4] \
195        [.p panecget .b -after]
196} -cleanup {
197    .p paneconfig .b -after [lindex [.p paneconfig .b -after] 3]
198} -result {.c .c}
199test panedwindow-1.40 {configuration options: -after (bad)} -body {
200    .p paneconfigure .b -after badValue
201} -returnCodes error -result {bad window path name "badValue"}
202test panedwindow-1.41 {configuration options: -before (good)} -body {
203    .p paneconfigure .b -before .c
204    list [lindex [.p paneconfigure .b -before] 4] \
205        [.p panecget .b -before]
206} -cleanup {
207    .p paneconfig .b -before [lindex [.p paneconfig .b -before] 3]
208} -result {.c .c}
209test panedwindow-1.42 {configuration options: -before (bad)} -body {
210    .p paneconfigure .b -before badValue
211} -returnCodes error -result {bad window path name "badValue"}
212test panedwindow-1.43 {configuration options: -height (good)} -body {
213    .p paneconfigure .b -height 10
214    list [lindex [.p paneconfigure .b -height] 4] \
215        [.p panecget .b -height]
216} -cleanup {
217    .p paneconfig .b -height [lindex [.p paneconfig .b -height] 3]
218} -result {10 10}
219test panedwindow-1.44 {configuration options: -height (bad)} -body {
220    .p paneconfigure .b -height badValue
221} -returnCodes error -result {bad screen distance "badValue"}
222test panedwindow-1.45 {configuration options: -hide (good)} -body {
223    .p paneconfigure .b -hide false
224    list [lindex [.p paneconfigure .b -hide] 4] \
225        [.p panecget .b -hide]
226} -cleanup {
227    .p paneconfig .b -hide [lindex [.p paneconfig .b -hide] 3]
228} -result {0 0}
229test panedwindow-1.46 {configuration options: -hide (bad)} -body {
230    .p paneconfigure .b -hide foo
231} -returnCodes error -result {expected boolean value but got "foo"}
232test panedwindow-1.47 {configuration options: -minsize (good)} -body {
233    .p paneconfigure .b -minsize 10
234    list [lindex [.p paneconfigure .b -minsize] 4] \
235        [.p panecget .b -minsize]
236} -cleanup {
237    .p paneconfig .b -minsize [lindex [.p paneconfig .b -minsize] 3]
238} -result {10 10}
239test panedwindow-1.48 {configuration options: -minsize (bad)} -body {
240    .p paneconfigure .b -minsize badValue
241} -returnCodes error -result {bad screen distance "badValue"}
242test panedwindow-1.49 {configuration options: -padx (good)} -body {
243    .p paneconfigure .b -padx 1.3
244    list [lindex [.p paneconfigure .b -padx] 4] \
245        [.p panecget .b -padx]
246} -cleanup {
247    .p paneconfig .b -padx [lindex [.p paneconfig .b -padx] 3]
248} -result {1 1}
249test panedwindow-1.50 {configuration options: -padx (bad)} -body {
250    .p paneconfigure .b -padx badValue
251} -returnCodes error -result {bad screen distance "badValue"}
252test panedwindow-1.51 {configuration options: -pady (good)} -body {
253    .p paneconfigure .b -pady 1.3
254    list [lindex [.p paneconfigure .b -pady] 4] \
255        [.p panecget .b -pady]
256} -cleanup {
257    .p paneconfig .b -pady [lindex [.p paneconfig .b -pady] 3]
258} -result {1 1}
259test panedwindow-1.52 {configuration options: -pady (bad)} -body {
260    .p paneconfigure .b -pady badValue
261} -returnCodes error -result {bad screen distance "badValue"}
262test panedwindow-1.53 {configuration options: -sticky (good)} -body {
263    .p paneconfigure .b -sticky nsew
264    list [lindex [.p paneconfigure .b -sticky] 4] \
265        [.p panecget .b -sticky]
266} -cleanup {
267    .p paneconfig .b -sticky [lindex [.p paneconfig .b -sticky] 3]
268} -result {nesw nesw}
269test panedwindow-1.54 {configuration options: -sticky (bad)} -body {
270    .p paneconfigure .b -sticky abcd
271} -returnCodes error -result {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w}
272test panedwindow-1.55 {configuration options: -stretch (good)} -body {
273    .p paneconfigure .b -stretch alw
274    list [lindex [.p paneconfigure .b -stretch] 4] \
275        [.p panecget .b -stretch]
276} -cleanup {
277    .p paneconfig .b -stretch [lindex [.p paneconfig .b -stretch] 3]
278} -result {always always}
279test panedwindow-1.56 {configuration options: -stretch (bad)} -body {
280    .p paneconfigure .b -stretch foo
281} -returnCodes error -result {bad stretch "foo": must be always, first, last, middle, or never}
282test panedwindow-1.57 {configuration options: -width (good)} -body {
283    .p paneconfigure .b -width 10
284    list [lindex [.p paneconfigure .b -width] 4] \
285        [.p panecget .b -width]
286} -cleanup {
287    .p paneconfig .b -width [lindex [.p paneconfig .b -width] 3]
288} -result {10 10}
289test panedwindow-1.58 {configuration options: -width (bad)} -body {
290    .p paneconfigure .b -width badValue
291} -returnCodes error -result {bad screen distance "badValue"}
292deleteWindows
293
294
295test panedwindow-2.1 {panedwindow widget command} -setup {
296	deleteWindows
297} -body {
298    panedwindow .p
299    .p foo
300} -cleanup {
301	deleteWindows
302} -returnCodes error -result {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash}
303
304
305test panedwindow-3.1 {panedwindow panes subcommand} -setup {
306	deleteWindows
307} -body {
308    panedwindow .p
309    .p add [button .b]
310    .p add [button .c]
311    set result [list [.p panes]]
312    .p forget .b
313    lappend result [.p panes]
314} -cleanup {
315	deleteWindows
316} -result [list [list .b .c] [list .c]]
317
318
319test panedwindow-4.1 {forget subcommand} -setup {
320	deleteWindows
321} -body {
322    panedwindow .p
323    .p forget
324} -cleanup {
325	deleteWindows
326} -returnCodes error -result {wrong # args: should be ".p forget widget ?widget ...?"}
327test panedwindow-4.2 {forget subcommand, forget one from start} -setup {
328	deleteWindows
329} -body {
330    panedwindow .p
331    .p add [button .b]
332    .p add [button .c]
333    set result [list [.p panes]]
334    .p forget .b
335    lappend result [.p panes]
336} -cleanup {
337	deleteWindows
338} -result [list {.b .c} .c]
339test panedwindow-4.3 {forget subcommand, forget one from end} -setup {
340	deleteWindows
341} -body {
342    panedwindow .p
343    .p add [button .b]
344    .p add [button .c]
345    .p add [button .d]
346    set result [list [.p panes]]
347    .p forget .d
348    update
349    lappend result [.p panes]
350} -cleanup {
351	deleteWindows
352} -result [list {.b .c .d} {.b .c}]
353test panedwindow-4.4 {forget subcommand, forget multiple} -setup {
354	deleteWindows
355} -body {
356    panedwindow .p
357    .p add [button .b]
358    .p add [button .c]
359    .p add [button .d]
360    set result [list [.p panes]]
361    .p forget .b .c
362    update
363    lappend result [.p panes]
364} -cleanup {
365	deleteWindows
366} -result [list {.b .c .d} .d]
367test panedwindow-4.5 {forget subcommand, panes are unmapped} -setup {
368	deleteWindows
369} -body {
370    panedwindow .p
371    .p add [button .b]
372    .p add [button .c]
373    pack .p
374    update
375    set result [list [winfo ismapped .b] [winfo ismapped .c]]
376    .p forget .b
377    update
378    lappend result [winfo ismapped .b] [winfo ismapped .c]
379} -cleanup {
380	deleteWindows
381} -result [list 1 1 0 1]
382test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} -setup {
383	deleteWindows
384} -body {
385    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
386    .p add [frame .f -width 20 -height 20] [frame .g -width 20 -height 20]
387    set result [list [winfo reqwidth .p]]
388    .p forget .f
389    lappend result [winfo reqwidth .p]
390} -cleanup {
391	deleteWindows
392} -result [list 44 20]
393
394
395test panedwindow-5.1 {sash subcommand} -setup {
396	deleteWindows
397} -body {
398    panedwindow .p
399    .p sash
400} -cleanup {
401	deleteWindows
402} -returnCodes error -result {wrong # args: should be ".p sash option ?arg ...?"}
403test panedwindow-5.2 {sash subcommand} -setup {
404	deleteWindows
405} -body {
406    panedwindow .p
407    .p sash foo
408} -cleanup {
409	deleteWindows
410} -returnCodes error -result {bad option "foo": must be coord, dragto, mark, or place}
411
412
413test panedwindow-6.1 {sash coord subcommand, errors} -setup {
414	deleteWindows
415} -body {
416    panedwindow .p
417    .p sash coord
418} -cleanup {
419	deleteWindows
420} -returnCodes error -result {wrong # args: should be ".p sash coord index"}
421test panedwindow-6.2 {sash coord subcommand, errors} -setup {
422	deleteWindows
423} -body {
424    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
425    .p sash coord 0
426} -cleanup {
427	deleteWindows
428} -returnCodes error -result {invalid sash index}
429test panedwindow-6.3 {sash coord subcommand, errors} -setup {
430	deleteWindows
431} -body {
432    panedwindow .p
433    .p sash coord foo
434} -cleanup {
435	deleteWindows
436} -returnCodes error -result {expected integer but got "foo"}
437test panedwindow-6.4 {sash coord subcommand sashes correctly placed} -setup {
438	deleteWindows
439} -body {
440    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
441    .p add [frame .p.f -width 20 -height 20] \
442	    [frame .p.f2 -width 20 -height 20] \
443	    [frame .p.f3 -width 20 -height 20]
444    .p sash coord 0
445} -cleanup {
446	deleteWindows
447} -result [list 22 0]
448test panedwindow-6.5 {sash coord subcommand sashes correctly placed} -setup {
449	deleteWindows
450} -body {
451    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
452    .p add [frame .p.f -width 20 -height 20] \
453	    [frame .p.f2 -width 20 -height 20] \
454	    [frame .p.f3 -width 20 -height 20]
455    .p sash coord 1
456} -cleanup {
457	deleteWindows
458} -result [list 50 0]
459test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} -setup {
460	deleteWindows
461} -body {
462    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
463            -showhandle false
464    .p add [frame .p.f -width 20 -height 20] \
465	    [frame .p.f2 -width 20 -height 20] \
466	    [frame .p.f3 -width 20 -height 20]
467    .p sash coord 0
468} -cleanup {
469	deleteWindows
470} -result [list 0 22]
471test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} -setup {
472	deleteWindows
473} -body {
474    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
475            -showhandle false
476    .p add [frame .p.f -width 20 -height 20] \
477	    [frame .p.f2 -width 20 -height 20] \
478	    [frame .p.f3 -width 20 -height 20]
479    .p sash coord 1
480} -cleanup {
481	deleteWindows
482} -result [list 0 50]
483test panedwindow-6.8 {sash coord subcommand, errors} -setup {
484	deleteWindows
485} -body {
486    panedwindow .p
487    list [catch {.p sash coord -1} msg] $msg \
488        [catch {.p sash coord  0} msg] $msg \
489        [catch {.p sash coord  1} msg] $msg
490} -cleanup {
491	deleteWindows
492} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
493test panedwindow-6.9 {sash coord subcommand, errors} -setup {
494	deleteWindows
495} -body {
496    # There are no sashes until you have 2 panes
497    panedwindow .p
498    .p add [frame .p.f]
499    list [catch {.p sash coord -1} msg] $msg \
500	    [catch {.p sash coord  0} msg] $msg \
501	    [catch {.p sash coord  1} msg] $msg
502} -cleanup {
503	deleteWindows
504} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
505test panedwindow-6.10 {sash coord subcommand, errors} -setup {
506	deleteWindows
507} -body {
508    # There are no sashes until you have 2 panes
509    panedwindow .p
510    .p add [frame .p.f] [frame .p.f2]
511    list [catch {.p sash coord -1} msg] $msg \
512	    [catch {.p sash coord  0} msg] \
513	    [catch {.p sash coord  1} msg] $msg \
514	    [catch {.p sash coord  2} msg] $msg
515} -cleanup {
516	deleteWindows
517} -result [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"]
518
519
520test panedwindow-7.1 {sash mark subcommand, errors} -setup {
521	deleteWindows
522} -body {
523    panedwindow .p
524    .p sash mark
525} -cleanup {
526	deleteWindows
527} -returnCodes error -result {wrong # args: should be ".p sash mark index ?x y?"}
528test panedwindow-7.2 {sash mark subcommand, errors} -setup {
529	deleteWindows
530} -body {
531    panedwindow .p
532    .p sash mark foo
533} -cleanup {
534	deleteWindows
535} -returnCodes error -result {expected integer but got "foo"}
536test panedwindow-7.3 {sash mark subcommand, errors} -setup {
537	deleteWindows
538} -body {
539    panedwindow .p
540    .p sash mark 0 foo bar
541} -cleanup {
542	deleteWindows
543} -returnCodes error -result {invalid sash index}
544test panedwindow-7.4 {sash mark subcommand, errors} -setup {
545	deleteWindows
546} -body {
547    panedwindow .p
548    .p add [button .b] [button .c]
549    .p sash mark 0 foo bar
550} -cleanup {
551	deleteWindows
552} -returnCodes error -result {expected integer but got "foo"}
553test panedwindow-7.5 {sash mark subcommand, errors} -setup {
554	deleteWindows
555} -body {
556    panedwindow .p
557    .p add [button .b] [button .c]
558    .p sash mark 0 0 bar
559} -cleanup {
560	deleteWindows
561} -returnCodes error -result {expected integer but got "bar"}
562test panedwindow-7.6 {sash mark subcommand, mark defaults to 0 0} -setup {
563	deleteWindows
564} -body {
565    panedwindow .p
566    .p add [button .b] [button .c]
567    .p sash mark 0
568} -cleanup {
569	deleteWindows
570} -result [list 0 0]
571test panedwindow-7.7 {sash mark subcommand, set mark} -setup {
572	deleteWindows
573} -body {
574    panedwindow .p
575    .p add [button .b] [button .c]
576    .p sash mark 0 10 10
577    .p sash mark 0
578} -cleanup {
579	deleteWindows
580} -result [list 10 10]
581
582
583test panedwindow-8.1 {sash dragto subcommand, errors} -setup {
584	deleteWindows
585} -body {
586    panedwindow .p
587    .p sash dragto
588} -cleanup {
589	deleteWindows
590} -returnCodes error -result {wrong # args: should be ".p sash dragto index x y"}
591test panedwindow-8.2 {sash dragto subcommand, errors} -setup {
592	deleteWindows
593} -body {
594    panedwindow .p
595    .p sash dragto foo bar baz
596} -cleanup {
597	deleteWindows
598} -returnCodes error -result {expected integer but got "foo"}
599test panedwindow-8.3 {sash dragto subcommand, errors} -setup {
600	deleteWindows
601} -body {
602    panedwindow .p
603    .p sash dragto 0 foo bar
604} -cleanup {
605	deleteWindows
606} -returnCodes error -result {invalid sash index}
607test panedwindow-8.4 {sash dragto subcommand, errors} -setup {
608	deleteWindows
609} -body {
610    panedwindow .p
611    .p add [button .b] [button .c]
612    .p sash dragto 0 foo bar
613} -cleanup {
614	deleteWindows
615} -returnCodes error -result {expected integer but got "foo"}
616test panedwindow-8.5 {sash dragto subcommand, errors} -setup {
617	deleteWindows
618} -body {
619    panedwindow .p
620    .p add [button .b] [button .c]
621    .p sash dragto 0 0 bar
622} -cleanup {
623	deleteWindows
624} -returnCodes error -result {expected integer but got "bar"}
625
626
627test panedwindow-9.1 {sash mark/sash dragto interaction} -setup {
628	deleteWindows
629} -body {
630    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
631    .p add [frame .f -width 20 -height 20] [button .c -text foobar]
632    .p sash mark 0 10 10
633    .p sash dragto 0 20 10
634    .p sash coord 0
635} -cleanup {
636	deleteWindows
637} -result [list 30 0]
638test panedwindow-9.2 {sash mark/sash dragto interaction} -setup {
639	deleteWindows
640} -body {
641    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical \
642            -showhandle false
643    .p add [frame .p.f -width 20 -height 20] [button .p.c -text foobar]
644    .p sash mark 0 10 10
645    .p sash dragto 0 10 20
646    .p sash coord 0
647} -cleanup {
648	deleteWindows
649} -result [list 0 30]
650test panedwindow-9.3 {sash mark/sash dragto, respects minsize} -setup {
651	deleteWindows
652} -body {
653    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
654    .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
655    .p sash mark 0 20 10
656    .p sash dragto 0 10 10
657    .p sash coord 0
658} -cleanup {
659	deleteWindows
660} -result [list 15 0]
661
662
663test panedwindow-10.1 {sash place subcommand, errors} -setup {
664	deleteWindows
665} -body {
666    panedwindow .p
667    .p sash place
668} -cleanup {
669	deleteWindows
670} -returnCodes error -result {wrong # args: should be ".p sash place index x y"}
671test panedwindow-10.2 {sash place subcommand, errors} -setup {
672	deleteWindows
673} -body {
674    panedwindow .p
675    .p sash place foo bar baz
676} -cleanup {
677	deleteWindows
678} -returnCodes error -result {expected integer but got "foo"}
679test panedwindow-10.3 {sash place subcommand, errors} -setup {
680	deleteWindows
681} -body {
682    panedwindow .p
683    .p sash place 0 foo bar
684} -cleanup {
685	deleteWindows
686} -returnCodes error -result {invalid sash index}
687test panedwindow-10.4 {sash place subcommand, errors} -setup {
688	deleteWindows
689} -body {
690    panedwindow .p
691    .p add [button .b] [button .c]
692    .p sash place 0 foo bar
693} -cleanup {
694	deleteWindows
695} -returnCodes error -result {expected integer but got "foo"}
696test panedwindow-10.5 {sash place subcommand, errors} -setup {
697	deleteWindows
698} -body {
699    panedwindow .p
700    .p add [button .b] [button .c]
701    .p sash place 0 0 bar
702} -cleanup {
703	deleteWindows
704} -returnCodes error -result {expected integer but got "bar"}
705test panedwindow-10.6 {sash place subcommand, moves sash} -setup {
706	deleteWindows
707} -body {
708    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
709    .p add [frame .f -width 20 -height 20] [button .c]
710    .p sash place 0 10 0
711    .p sash coord 0
712} -cleanup {
713	deleteWindows
714} -result [list 10 0]
715test panedwindow-10.7 {sash place subcommand, moves sash} -setup {
716	deleteWindows
717} -body {
718    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical
719    .p add [frame .f -width 20 -height 20] [button .c]
720    .p sash place 0 0 10
721    .p sash coord 0
722} -cleanup {
723	deleteWindows
724} -result [list 0 10]
725test panedwindow-10.8 {sash place subcommand, respects minsize} -setup {
726	deleteWindows
727} -body {
728    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
729    .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
730    .p sash place 0 10 0
731    .p sash coord 0
732} -cleanup {
733	deleteWindows
734} -result [list 15 0]
735test panedwindow-10.9 {sash place subcommand, respects minsize} -setup {
736	deleteWindows
737} -body {
738    panedwindow .p
739    .p add [frame .f -width 20 -height 20 -bg pink]
740    .p sash place 0 2 0
741} -cleanup {
742	deleteWindows
743} -returnCodes error -result {invalid sash index}
744
745
746test panedwindow-11.1 {moving sash changes size of pane to left} -setup {
747	deleteWindows
748} -body {
749    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
750    .p add [frame .f -width 20 -height 20] [button .c -text foobar] -sticky nsew
751    .p sash place 0 30 0
752    pack .p
753    update
754    winfo width .f
755} -result 30
756test panedwindow-11.2 {moving sash changes size of pane to right} -setup {
757	deleteWindows
758} -body {
759    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
760    .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
761    pack .p
762    update
763    set result [winfo width .f2]
764    .p sash place 0 30 0
765    update
766    lappend result [winfo width .f2]
767} -cleanup {
768	deleteWindows
769} -result {20 10}
770test panedwindow-11.3 {moving sash does not change reqsize of panedwindow} -setup {
771	deleteWindows
772} -body {
773    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
774    .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
775    .p sash place 0 30 0
776    winfo reqwidth .p
777} -result 44
778test panedwindow-11.4 {moving sash changes size of pane above} -setup {
779	deleteWindows
780} -body {
781    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
782            -orient vertical
783    .p add [frame .f -width 20 -height 10] [button .c -text foobar] -sticky nsew
784    .p sash place 0 0 20
785    pack .p
786    update
787    set result [winfo height .f]
788    set result
789} -result 20
790test panedwindow-11.5 {moving sash changes size of pane below} -setup {
791	deleteWindows
792} -body {
793    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
794            -orient vertical
795    .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
796    pack .p
797    update
798    set result [winfo height .f2]
799    .p sash place 0 0 15
800    update
801    lappend result [winfo height .f2]
802    set result
803} -cleanup {
804	deleteWindows
805} -result {10 5}
806test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setup {
807	deleteWindows
808} -body {
809    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
810            -orient vertical
811    .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
812    set result [winfo reqheight .p]
813    .p sash place 0 0 20
814    lappend result [winfo reqheight .p]
815    set result
816} -cleanup {
817	deleteWindows
818} -result [list 24 24]
819test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup {
820	deleteWindows
821} -body {
822    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
823            -orient vertical
824    .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
825    set result [winfo reqheight .f]
826    .p sash place 0 0 20
827    lappend result [winfo reqheight .f]
828} -cleanup {
829	deleteWindows
830} -result [list 10 10]
831test panedwindow-11.8 {moving sash restricted to minsize} -setup {
832	deleteWindows
833} -body {
834    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
835    .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
836    .p sash place 0 10 0
837    pack .p
838    update
839    winfo width .f
840} -result 15
841test panedwindow-11.9 {moving sash restricted to minsize} -setup {
842	deleteWindows
843} -body {
844    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
845            -orient vertical
846    .p add [frame .f -width 20 -height 30] [button .c] -minsize 10
847    .p sash place 0 0 5
848    pack .p
849    update
850    winfo height .f
851} -result 10
852test panedwindow-11.10 {moving sash in unmapped window restricted to reqsize} -setup {
853	deleteWindows
854} -body {
855    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
856    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20]
857    set result [list [.p sash coord 0]]
858    .p sash place 0 100 0
859    lappend result [.p sash coord 0]
860} -cleanup {
861	deleteWindows
862} -result [list {20 0} {40 0}]
863test panedwindow-11.11 {moving sash right pushes other sashes} -setup {
864	deleteWindows
865} -body {
866    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
867    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
868	    [frame .f3 -width 20 -height 30]
869    .p sash place 0 80 0
870    list [.p sash coord 0] [.p sash coord 1]
871} -cleanup {
872	deleteWindows
873} -result {{60 0} {64 0}}
874test panedwindow-11.12 {moving sash left pushes other sashes} -setup {
875	deleteWindows
876} -body {
877    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
878    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
879	    [frame .f3 -width 20 -height 30]
880    .p sash place 1 0 0
881    list [.p sash coord 0] [.p sash coord 1]
882} -cleanup {
883	deleteWindows
884} -result {{0 0} {4 0}}
885test panedwindow-11.13 {move sash in mapped window restricted to visible win} -setup {
886	deleteWindows
887} -body {
888    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
889    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
890	    [frame .f3 -width 20 -height 30]
891    place .p -width 50
892    update
893    .p sash place 1 100 0
894    update
895    .p sash coord 1
896} -cleanup {
897	deleteWindows
898} -result {46 0}
899test panedwindow-11.14 {move sash in mapped window restricted to visible win} -setup {
900	deleteWindows
901} -body {
902    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
903    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
904	    [frame .f3 -width 20 -height 30]
905    place .p -width 100
906    update
907    .p sash place 1 200 0
908    update
909    .p sash coord 1
910} -cleanup {
911	deleteWindows
912} -result {96 0}
913test panedwindow-11.15 {moving sash into "virtual" space on last pane increases reqsize} -setup {
914	deleteWindows
915} -body {
916    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
917    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
918	    [frame .f3 -width 20 -height 30]
919    place .p -width 100
920    set result [winfo reqwidth .p]
921    update
922    .p sash place 1 200 0
923    update
924    lappend result [winfo reqwidth .p]
925} -cleanup {
926	deleteWindows
927} -result {68 100}
928
929
930test panedwindow-12.1 {horizontal panedwindow lays out widgets properly} -setup {
931	deleteWindows
932    set result {}
933} -body {
934    panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2
935    foreach win {.p.f .p.f2 .p.f3} {.p add [frame $win -width 20 -height 10]}
936    pack .p
937    update
938    foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
939    return $result
940} -cleanup {
941	deleteWindows
942} -result [list 2 2 28 2 54 2]
943test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup {
944	deleteWindows
945    set result {}
946} -body {
947    panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2 \
948            -orient vertical
949    foreach win {.p.f .p.f2 .p.f3} {.p add [frame $win -width 20 -height 10]}
950    pack .p
951    update
952    foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
953    return $result
954} -cleanup {
955	deleteWindows
956} -result [list 2 2 2 18 2 34]
957test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup {
958	deleteWindows
959} -body {
960    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
961    foreach {win color} {.p.f blue .p.f2 green} {
962	    .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
963            -sticky ""
964    }
965    pack .p
966    update
967    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
968    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
969    .p paneconfigure .p.f -padx 0 -pady 0
970    update
971    lappend result [winfo reqwidth .p] [winfo reqheight .p]
972    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
973    return $result
974} -cleanup {
975	deleteWindows
976} -result [list 80 30 10 5 50 5 60 30 0 5 30 5]
977test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup {
978	deleteWindows
979} -body {
980    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
981            -orient vertical
982    foreach win {.p.f .p.f2} {
983	.p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky ""
984    }
985    pack .p
986    update
987    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
988    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
989    .p paneconfigure .p.f -padx 0 -pady 0
990    update
991    lappend result [winfo reqwidth .p] [winfo reqheight .p]
992    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
993    return $result
994} -cleanup {
995	deleteWindows
996} -result [list 40 60 10 5 10 35 40 50 10 0 10 25]
997test panedwindow-12.5 {panedwindow respects reqsize of panes when possible} -setup {
998	deleteWindows
999} -body {
1000    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1001    .p add [frame .p.f -width 20 -height 20] -sticky ""
1002    place .p -width 40
1003    update
1004    set result [list [winfo width .p.f]]
1005    .p.f configure -width 30
1006    update
1007    lappend result [winfo width .p.f]
1008} -cleanup {
1009	deleteWindows
1010} -result [list 20 30]
1011test panedwindow-12.6 {panedwindow takes explicit widget width over reqwidth} -setup {
1012	deleteWindows
1013} -body {
1014    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1015    .p add [frame .p.f -width 20 -height 20] -width 20 -sticky ""
1016    place .p -width 40
1017    update
1018    set result [list [winfo width .p.f]]
1019    .p.f configure -width 30
1020    update
1021    lappend result [winfo width .p.f]
1022} -cleanup {
1023	deleteWindows
1024} -result [list 20 20]
1025test panedwindow-12.7 {horizontal panedwindow reqheight is max pane height} -setup {
1026	deleteWindows
1027} -body {
1028    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
1029    .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20]
1030    set result [winfo reqheight .p]
1031    .p.f config -height 40
1032    lappend result [winfo reqheight .p]
1033} -cleanup {
1034	deleteWindows
1035} -result {20 40}
1036test panedwindow-12.8 {horizontal panedwindow reqheight is max pane height} -setup {
1037	deleteWindows
1038} -body {
1039    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
1040    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
1041    .p paneconfigure .p.f -height 15
1042    set result [winfo reqheight .p]
1043    .p.f config -height 40
1044    lappend result [winfo reqheight .p]
1045} -cleanup {
1046	deleteWindows
1047} -result {20 20}
1048test panedwindow-12.9 {panedwindow pane width overrides widget width} -setup {
1049	deleteWindows
1050} -body {
1051    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
1052    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
1053    .p sash place 0 10 0
1054    pack .p
1055    update
1056    set result [winfo width .p.f]
1057    .p paneconfigure .p.f -width 30
1058    lappend result [winfo width .p.f]
1059} -cleanup {
1060	deleteWindows
1061} -result [list 10 10]
1062test panedwindow-12.10 {panedwindow respects reqsize of panes when possible} -setup {
1063	deleteWindows
1064} -body {
1065    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1066    .p add [frame .p.f -width 20 -height 20] -sticky ""
1067    place .p -height 40
1068    update
1069    set result [list [winfo height .p.f]]
1070    .p.f configure -height 30
1071    update
1072    lappend result [winfo height .p.f]
1073} -cleanup {
1074	deleteWindows
1075} -result [list 20 30]
1076test panedwindow-12.11 {panedwindow takes explicit height over reqheight} -setup {
1077	deleteWindows
1078} -body {
1079    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1080    .p add [frame .p.f -width 20 -height 20] -height 20 -sticky ""
1081    place .p -height 40
1082    update
1083    set result [list [winfo height .p.f]]
1084    .p.f configure -height 30
1085    update
1086    lappend result [winfo height .p.f]
1087} -cleanup {
1088	deleteWindows
1089} -result [list 20 20]
1090test panedwindow-12.12 {vertical panedwindow reqwidth is max pane width} -setup {
1091	deleteWindows
1092} -body {
1093    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
1094            -orient vertical
1095    .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20]
1096    set result [winfo reqwidth .p]
1097    .p.f config -width 40
1098    lappend result [winfo reqwidth .p]
1099} -cleanup {
1100	deleteWindows
1101} -result {20 40}
1102test panedwindow-12.13 {vertical panedwindow reqwidth is max pane width} -setup {
1103	deleteWindows
1104} -body {
1105    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
1106            -orient vertical
1107    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
1108    .p paneconfigure .p.f -width 15
1109    set result [winfo reqwidth .p]
1110    .p.f config -width 40
1111    lappend result [winfo reqwidth .p]
1112} -cleanup {
1113	deleteWindows
1114} -result {20 20}
1115test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup {
1116	deleteWindows
1117} -body {
1118    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
1119            -orient vertical
1120    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
1121    .p sash place 0 0 10
1122    pack .p
1123    update
1124    set result [winfo height .p.f]
1125    .p paneconfigure .p.f -height 30
1126    lappend result [winfo height .p.f]
1127} -cleanup {
1128	deleteWindows
1129} -result [list 10 10]
1130
1131
1132test panedwindow-13.1 {PanestructureProc, widget yields managements} -setup {
1133	deleteWindows
1134} -body {
1135    # Check that the panedwindow correctly yields geometry management of
1136    # a pane when the pane is destroyed.
1137
1138    # This test should not cause a core dump, and it should not cause
1139    # a memory leak.
1140    panedwindow .p
1141    .p add [button .b]
1142    destroy .p
1143    pack .b
1144    destroy .b
1145    set result ""
1146} -result {}
1147test panedwindow-13.2 {PanedWindowLostPaneProc, widget yields management} -setup {
1148	deleteWindows
1149} -body {
1150    # Check that the paned window correctly yields geometry management of
1151    # a pane when some other geometry manager steals the pane from us.
1152
1153    # This test should not cause a core dump, and it should not cause a
1154    # memory leak.
1155    panedwindow .p
1156    .p add [button .b]
1157    pack .p
1158    update
1159    pack .b
1160    update
1161    set result [.p panes]
1162    destroy .p .b
1163    set result
1164} -result {}
1165
1166
1167test panedwindow-14.1 {panedwindow sticky settings} -setup {
1168    deleteWindows
1169} -body {
1170    panedwindow .p -showhandle false
1171    .p add [button .b]
1172    .p paneconfigure .b -sticky n
1173    .p panecget .b -sticky
1174} -cleanup {
1175    deleteWindows
1176} -result {n}
1177test panedwindow-14.2 {panedwindow sticky settings} -setup {
1178    deleteWindows
1179} -body {
1180    panedwindow .p -showhandle false
1181    .p add [button .b]
1182    .p paneconfigure .b -sticky s
1183    .p panecget .b -sticky
1184} -cleanup {
1185    deleteWindows
1186} -result {s}
1187test panedwindow-14.3 {panedwindow sticky settings} -setup {
1188    deleteWindows
1189} -body {
1190    panedwindow .p -showhandle false
1191    .p add [button .b]
1192    .p paneconfigure .b -sticky e
1193    .p panecget .b -sticky
1194} -cleanup {
1195    deleteWindows
1196} -result {e}
1197test panedwindow-14.4 {panedwindow sticky settings} -setup {
1198    deleteWindows
1199} -body {
1200    panedwindow .p -showhandle false
1201    .p add [button .b]
1202    .p paneconfigure .b -sticky w
1203    .p panecget .b -sticky
1204} -cleanup {
1205    deleteWindows
1206} -result {w}
1207test panedwindow-14.5 {panedwindow sticky settings} -setup {
1208    deleteWindows
1209} -body {
1210    panedwindow .p -showhandle false
1211    .p add [button .b]
1212    .p paneconfigure .b -sticky sn
1213    .p panecget .b -sticky
1214} -cleanup {
1215    deleteWindows
1216} -result {ns}
1217test panedwindow-14.6 {panedwindow sticky settings} -setup {
1218    deleteWindows
1219} -body {
1220    panedwindow .p -showhandle false
1221    .p add [button .b]
1222    .p paneconfigure .b -sticky ns
1223    .p panecget .b -sticky
1224} -cleanup {
1225    deleteWindows
1226} -result {ns}
1227test panedwindow-14.7 {panedwindow sticky settings} -setup {
1228    deleteWindows
1229} -body {
1230    panedwindow .p -showhandle false
1231    .p add [button .b]
1232    .p paneconfigure .b -sticky en
1233    .p panecget .b -sticky
1234} -cleanup {
1235    deleteWindows
1236} -result {ne}
1237test panedwindow-14.8 {panedwindow sticky settings} -setup {
1238    deleteWindows
1239} -body {
1240    panedwindow .p -showhandle false
1241    .p add [button .b]
1242    .p paneconfigure .b -sticky ne
1243    .p panecget .b -sticky
1244} -cleanup {
1245    deleteWindows
1246} -result {ne}
1247test panedwindow-14.9 {panedwindow sticky settings} -setup {
1248    deleteWindows
1249} -body {
1250    panedwindow .p -showhandle false
1251    .p add [button .b]
1252    .p paneconfigure .b -sticky wn
1253    .p panecget .b -sticky
1254} -cleanup {
1255    deleteWindows
1256} -result {nw}
1257test panedwindow-14.10 {panedwindow sticky settings} -setup {
1258    deleteWindows
1259} -body {
1260    panedwindow .p -showhandle false
1261    .p add [button .b]
1262    .p paneconfigure .b -sticky nw
1263    .p panecget .b -sticky
1264} -cleanup {
1265    deleteWindows
1266} -result {nw}
1267test panedwindow-14.11 {panedwindow sticky settings} -setup {
1268    deleteWindows
1269} -body {
1270    panedwindow .p -showhandle false
1271    .p add [button .b]
1272    .p paneconfigure .b -sticky esn
1273    .p panecget .b -sticky
1274} -cleanup {
1275    deleteWindows
1276} -result {nes}
1277test panedwindow-14.12 {panedwindow sticky settings} -setup {
1278    deleteWindows
1279} -body {
1280    panedwindow .p -showhandle false
1281    .p add [button .b]
1282    .p paneconfigure .b -sticky nse
1283    .p panecget .b -sticky
1284} -cleanup {
1285    deleteWindows
1286} -result {nes}
1287test panedwindow-14.13 {panedwindow sticky settings} -setup {
1288    deleteWindows
1289} -body {
1290    panedwindow .p -showhandle false
1291    .p add [button .b]
1292    .p paneconfigure .b -sticky nsw
1293    .p panecget .b -sticky
1294} -cleanup {
1295    deleteWindows
1296} -result {nsw}
1297test panedwindow-14.14 {panedwindow sticky settings} -setup {
1298    deleteWindows
1299} -body {
1300    panedwindow .p -showhandle false
1301    .p add [button .b]
1302    .p paneconfigure .b -sticky nsew
1303    .p panecget .b -sticky
1304} -cleanup {
1305    deleteWindows
1306} -result {nesw}
1307test panedwindow-14.15 {panedwindow sticky settings} -setup {
1308    deleteWindows
1309} -body {
1310    panedwindow .p -showhandle false
1311    .p add [button .b]
1312    .p paneconfigure .b -sticky ""
1313    .p panecget .b -sticky
1314} -cleanup {
1315    deleteWindows
1316} -result {}
1317
1318
1319test panedwindow-15.1 {panedwindow sticky works} -setup {
1320    deleteWindows
1321} -body {
1322    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1323    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky {}
1324    place .p -width 40 -height 40
1325    update
1326    list {} [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1327} -cleanup {
1328    deleteWindows
1329} -result {{} 10 10 20 20}
1330test panedwindow-15.2 {panedwindow sticky works} -setup {
1331    deleteWindows
1332} -body {
1333    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1334    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky n
1335    place .p -width 40 -height 40
1336    update
1337    list n [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1338} -cleanup {
1339    deleteWindows
1340} -result {n 10 0 20 20}
1341test panedwindow-15.3 {panedwindow sticky works} -setup {
1342    deleteWindows
1343} -body {
1344    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1345    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky s
1346    place .p -width 40 -height 40
1347    update
1348    list s [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1349} -cleanup {
1350    deleteWindows
1351} -result {s 10 20 20 20}
1352test panedwindow-15.4 {panedwindow sticky works} -setup {
1353    deleteWindows
1354} -body {
1355    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1356    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky e
1357    place .p -width 40 -height 40
1358    update
1359    list e [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1360} -cleanup {
1361    deleteWindows
1362} -result {e 20 10 20 20}
1363test panedwindow-15.5 {panedwindow sticky works} -setup {
1364    deleteWindows
1365} -body {
1366    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1367    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky w
1368    place .p -width 40 -height 40
1369    update
1370    list w [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1371} -cleanup {
1372    deleteWindows
1373} -result {w 0 10 20 20}
1374test panedwindow-15.6 {panedwindow sticky works} -setup {
1375    deleteWindows
1376} -body {
1377    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1378    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ns
1379    place .p -width 40 -height 40
1380    update
1381    list ns [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1382} -cleanup {
1383    deleteWindows
1384} -result {ns 10 0 20 40}
1385test panedwindow-15.7 {panedwindow sticky works} -setup {
1386    deleteWindows
1387} -body {
1388    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1389    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ew
1390    place .p -width 40 -height 40
1391    update
1392    list ew [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1393} -cleanup {
1394    deleteWindows
1395} -result {ew 0 10 40 20}
1396test panedwindow-15.8 {panedwindow sticky works} -setup {
1397    deleteWindows
1398} -body {
1399    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1400    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nw
1401    place .p -width 40 -height 40
1402    update
1403    list nw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1404} -cleanup {
1405    deleteWindows
1406} -result {nw 0 0 20 20}
1407test panedwindow-15.9 {panedwindow sticky works} -setup {
1408    deleteWindows
1409} -body {
1410    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1411    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ne
1412    place .p -width 40 -height 40
1413    update
1414    list ne [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1415} -cleanup {
1416    deleteWindows
1417} -result {ne 20 0 20 20}
1418test panedwindow-15.10 {panedwindow sticky works} -setup {
1419    deleteWindows
1420} -body {
1421    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1422    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky se
1423    place .p -width 40 -height 40
1424    update
1425    list se [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1426} -cleanup {
1427    deleteWindows
1428} -result {se 20 20 20 20}
1429test panedwindow-15.11 {panedwindow sticky works} -setup {
1430    deleteWindows
1431} -body {
1432    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1433    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sw
1434    place .p -width 40 -height 40
1435    update
1436    list sw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1437} -cleanup {
1438    deleteWindows
1439} -result {sw 0 20 20 20}
1440test panedwindow-15.12 {panedwindow sticky works} -setup {
1441    deleteWindows
1442} -body {
1443    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1444    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nse
1445    place .p -width 40 -height 40
1446    update
1447    list nse [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1448} -cleanup {
1449    deleteWindows
1450} -result {nse 20 0 20 40}
1451test panedwindow-15.13 {panedwindow sticky works} -setup {
1452    deleteWindows
1453} -body {
1454    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1455    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nsw
1456    place .p -width 40 -height 40
1457    update
1458    list nsw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1459} -cleanup {
1460    deleteWindows
1461} -result {nsw 0 0 20 40}
1462test panedwindow-15.14 {panedwindow sticky works} -setup {
1463    deleteWindows
1464} -body {
1465    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1466    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sew
1467    place .p -width 40 -height 40
1468    update
1469    list sew [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1470} -cleanup {
1471    deleteWindows
1472} -result {sew 0 20 40 20}
1473test panedwindow-15.15 {panedwindow sticky works} -setup {
1474    deleteWindows
1475} -body {
1476    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1477    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky new
1478    place .p -width 40 -height 40
1479    update
1480    list new [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1481} -cleanup {
1482    deleteWindows
1483} -result {new 0 0 40 20}
1484test panedwindow-15.16 {panedwindow sticky works} -setup {
1485    deleteWindows
1486} -body {
1487    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
1488    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky news
1489    place .p -width 40 -height 40
1490    update
1491    list news [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
1492} -cleanup {
1493    deleteWindows
1494} -result {news 0 0 40 40}
1495
1496
1497test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setup {
1498	deleteWindows
1499} -body {
1500    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1501    .p add [frame .p.f -height 20 -width 20 -bg red]
1502    set result [winfo reqwidth .p]
1503    .p paneconfigure .p.f -minsize 40
1504    lappend result [winfo reqwidth .p]
1505} -cleanup {
1506	deleteWindows
1507} -result [list 20 40]
1508
1509
1510test panedwindow-17.1 {MoveSash, move right} -setup {
1511	deleteWindows
1512    set result {}
1513} -body {
1514    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1515    foreach w {.f1 .f2} c {red blue} {
1516	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1517    }
1518
1519    # Get the requested width of the paned window
1520    lappend result [winfo reqwidth .p]
1521
1522    .p sash place 0 30 0
1523
1524    # Get the reqwidth again, to make sure it hasn't changed
1525    lappend result [winfo reqwidth .p]
1526
1527    # Check that the sash moved
1528    lappend result [.p sash coord 0]
1529} -cleanup {
1530	deleteWindows
1531} -result [list 42 42 {30 0}]
1532test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -setup {
1533	deleteWindows
1534} -body {
1535    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1536    foreach w {.f1 .f2} c {red blue} {
1537	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1538    }
1539
1540    .p sash place 0 100 0
1541
1542    # Get the new sash coord; it should be clipped by the reqwidth of
1543    # the panedwindow.
1544    .p sash coord 0
1545} -cleanup {
1546	deleteWindows
1547} -result [list 40 0]
1548test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} -setup {
1549	deleteWindows
1550} -body {
1551    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1552    foreach w {.f1 .f2} c {red blue} {
1553	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1554    }
1555
1556    # Put the panedwindow up on the display and give it a width < reqwidth
1557    place .p -x 0 -y 0 -width 32
1558    update
1559
1560    .p sash place 0 100 0
1561
1562    # Get the new sash coord; it should be clipped by the visible width of
1563    # the panedwindow.
1564    .p sash coord 0
1565} -cleanup {
1566	deleteWindows
1567} -result [list 30 0]
1568test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} -setup {
1569	deleteWindows
1570} -body {
1571    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1572    foreach w {.f1 .f2} c {red blue} {
1573	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1574    }
1575
1576    # Put the panedwindow up on the display and give it a width > reqwidth
1577    place .p -x 0 -y 0 -width 102
1578    update
1579
1580    .p sash place 0 200 0
1581
1582    # Get the new sash coord; it should be clipped by the visible width of
1583    # the panedwindow.
1584    .p sash coord 0
1585} -cleanup {
1586	deleteWindows
1587} -result [list 100 0]
1588test panedwindow-17.5 {MoveSash, move right respects minsize} -setup {
1589	deleteWindows
1590} -body {
1591    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1592    foreach w {.f1 .f2} c {red blue} {
1593	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1594    }
1595
1596    .p sash place 0 100 0
1597
1598    # Get the new sash coord; it should have moved as far as possible while
1599    # respecting minsizes.
1600    .p sash coord 0
1601} -cleanup {
1602	deleteWindows
1603} -result [list 30 0]
1604test panedwindow-17.6 {MoveSash, move right respects minsize} -setup {
1605	deleteWindows
1606} -body {
1607    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1608    foreach w {.f1 .f2 .f3} c {red blue} {
1609	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1610    }
1611
1612    .p sash place 0 100 0
1613
1614    # Get the new sash coord; it should have moved as far as possible.
1615    .p sash coord 0
1616} -cleanup {
1617	deleteWindows
1618} -result [list 40 0]
1619test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup {
1620	deleteWindows
1621} -body {
1622    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1623    foreach w {.f1 .f2 .f3} c {red blue} {
1624	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1625    }
1626
1627    .p sash place 0 100 0
1628
1629    # Get the new sash coord; it should have moved as far as possible while
1630    # respecting minsizes.
1631    .p sash coord 1
1632} -cleanup {
1633	deleteWindows
1634} -result [list 62 0]
1635test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsize} -setup {
1636	deleteWindows
1637} -body {
1638    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1639    foreach w {.f1 .f2 .f3} c {red blue} {
1640	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1641    }
1642
1643    .p sash place 0 100 0
1644
1645    # Get the new sash coord; it should have moved as far as possible while
1646    # respecting minsizes.
1647    .p sash coord 1
1648} -cleanup {
1649	deleteWindows
1650} -result [list 52 0]
1651test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setup {
1652	deleteWindows
1653} -body {
1654    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1655    foreach w {.f1 .f2 .f3} c {red blue} {
1656	    .p add [frame $w -height 20 -width 20 -bg $c] \
1657		    -sticky nsew -minsize 10 -padx 5
1658    }
1659
1660    .p sash place 0 100 0
1661
1662    # Get the new sash coord; it should have moved as far as possible,
1663    # respecting minsizes.
1664    .p sash coord 0
1665} -cleanup {
1666	deleteWindows
1667} -result [list 50 0]
1668test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup {
1669	deleteWindows
1670} -body {
1671    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1672    foreach w {.f1 .f2 .f3} c {red blue} {
1673	    .p add [frame $w -height 20 -width 20 -bg $c] \
1674		    -sticky nsew -minsize -50
1675    }
1676
1677    .p sash place 0 50 0
1678
1679    # Get the new sash coord; it should have moved as far as possible,
1680    # respecting minsizes.
1681    list [.p sash coord 0] [.p sash coord 1]
1682} -cleanup {
1683	deleteWindows
1684} -result [list [list 50 0] [list 52 0]]
1685test panedwindow-17.11 {MoveSash, move left} -setup {
1686	deleteWindows
1687} -body {
1688    set result {}
1689    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1690    foreach w {.f1 .f2} c {red blue} {
1691	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1692    }
1693
1694    # Get the requested width of the paned window
1695    lappend result [winfo reqwidth .p]
1696
1697    .p sash place 0 10 0
1698
1699    # Get the reqwidth again, to make sure it hasn't changed
1700    lappend result [winfo reqwidth .p]
1701
1702    # Check that the sash moved
1703    lappend result [.p sash coord 0]
1704} -cleanup {
1705	deleteWindows
1706} -result [list 42 42 {10 0}]
1707test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setup {
1708	deleteWindows
1709} -body {
1710    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1711    foreach w {.f1 .f2} c {red blue} {
1712	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1713    }
1714
1715    .p sash place 0 -100 0
1716
1717    # Get the new sash coord; it should be clipped by the reqwidth of
1718    # the panedwindow.
1719    .p sash coord 0
1720} -cleanup {
1721	deleteWindows
1722} -result [list 0 0]
1723test panedwindow-17.13 {MoveSash, move left respects minsize} -setup {
1724	deleteWindows
1725} -body {
1726    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1727    foreach w {.f1 .f2} c {red blue} {
1728	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1729    }
1730
1731    .p sash place 0 0 0
1732
1733    # Get the new sash coord; it should have moved as far as possible while
1734    # respecting minsizes.
1735    .p sash coord 0
1736} -cleanup {
1737	deleteWindows
1738} -result [list 10 0]
1739test panedwindow-17.14 {MoveSash, move left respects minsize} -setup {
1740	deleteWindows
1741} -body {
1742    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1743    foreach w {.f1 .f2 .f3} c {red blue} {
1744	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1745    }
1746
1747    .p sash place 1 0 0
1748
1749    # Get the new sash coord; it should have moved as far as possible.
1750    .p sash coord 1
1751} -cleanup {
1752	deleteWindows
1753} -result [list 22 0]
1754test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup {
1755	deleteWindows
1756} -body {
1757    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1758    foreach w {.f1 .f2 .f3} c {red blue} {
1759	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1760    }
1761
1762    .p sash place 1 0 0
1763
1764    # Get the new sash coord; it should have moved as far as possible while
1765    # respecting minsizes.
1766    .p sash coord 0
1767} -cleanup {
1768	deleteWindows
1769} -result [list 0 0]
1770test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsize} -setup {
1771	deleteWindows
1772} -body {
1773    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1774    foreach w {.f1 .f2 .f3} c {red blue} {
1775	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1776    }
1777
1778    .p sash place 1 0 0
1779
1780    # Get the new sash coord; it should have moved as far as possible while
1781    # respecting minsizes.
1782    .p sash coord 0
1783} -cleanup {
1784	deleteWindows
1785} -result [list 10 0]
1786test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setup {
1787	deleteWindows
1788} -body {
1789    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1790    foreach w {.f1 .f2 .f3} c {red blue} {
1791	    .p add [frame $w -height 20 -width 20 -bg $c] \
1792		    -sticky nsew -minsize 10 -padx 5
1793    }
1794
1795    .p sash place 1 0 0
1796
1797    # Get the new sash coord; it should have moved as far as possible,
1798    # respecting minsizes.
1799    .p sash coord 1
1800} -cleanup {
1801	deleteWindows
1802} -result [list 42 0]
1803test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup {
1804	deleteWindows
1805} -body {
1806    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
1807    foreach w {.f1 .f2 .f3} c {red blue green} {
1808	    .p add [frame $w -height 20 -width 20 -bg $c] \
1809		    -sticky nsew -minsize -50
1810    }
1811
1812    .p sash place 1 10 0
1813
1814    # Get the new sash coord; it should have moved as far as possible,
1815    # respecting minsizes.
1816    list [.p sash coord 0] [.p sash coord 1]
1817} -cleanup {
1818	deleteWindows
1819} -result [list [list 8 0] [list 10 0]]
1820
1821
1822test panedwindow-18.1 {MoveSash, move down} -setup {
1823	deleteWindows
1824} -body {
1825    set result {}
1826    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1827            -orient vertical
1828    foreach w {.f1 .f2} c {red blue} {
1829	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1830    }
1831
1832    # Get the requested width of the paned window
1833    lappend result [winfo reqheight .p]
1834
1835    .p sash place 0 0 30
1836
1837    # Get the reqwidth again, to make sure it hasn't changed
1838    lappend result [winfo reqheight .p]
1839
1840    # Check that the sash moved
1841    lappend result [.p sash coord 0]
1842} -cleanup {
1843	deleteWindows
1844} -result [list 42 42 {0 30}]
1845test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -setup {
1846	deleteWindows
1847} -body {
1848    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1849            -orient vertical
1850    foreach w {.f1 .f2} c {red blue} {
1851	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1852    }
1853
1854    .p sash place 0 0 100
1855
1856    # Get the new sash coord; it should be clipped by the reqheight of
1857    # the panedwindow.
1858    .p sash coord 0
1859} -cleanup {
1860	deleteWindows
1861} -result [list 0 40]
1862test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} -setup {
1863	deleteWindows
1864} -body {
1865    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1866            -orient vertical
1867    foreach w {.f1 .f2} c {red blue} {
1868	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1869    }
1870
1871    # Put the panedwindow up on the display and give it a height < reqheight
1872    place .p -x 0 -y 0 -height 32
1873    update
1874
1875    .p sash place 0 0 100
1876
1877    # Get the new sash coord; it should be clipped by the visible height of
1878    # the panedwindow.
1879    .p sash coord 0
1880} -cleanup {
1881	deleteWindows
1882} -result [list 0 30]
1883test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} -setup {
1884	deleteWindows
1885} -body {
1886    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1887            -orient vertical
1888    foreach w {.f1 .f2} c {red blue} {
1889	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1890    }
1891
1892    # Put the panedwindow up on the display and give it a width > reqwidth
1893    place .p -x 0 -y 0 -height 102
1894    update
1895
1896    .p sash place 0 0 200
1897
1898    # Get the new sash coord; it should be clipped by the visible width of
1899    # the panedwindow.
1900    .p sash coord 0
1901} -cleanup {
1902	deleteWindows
1903} -result [list 0 100]
1904test panedwindow-18.5 {MoveSash, move down respects minsize} -setup {
1905	deleteWindows
1906} -body {
1907    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1908            -orient vertical
1909    foreach w {.f1 .f2} c {red blue} {
1910	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1911    }
1912
1913    .p sash place 0 0 100
1914
1915    # Get the new sash coord; it should have moved as far as possible while
1916    # respecting minsizes.
1917    .p sash coord 0
1918} -cleanup {
1919	deleteWindows
1920} -result [list 0 30]
1921test panedwindow-18.6 {MoveSash, move down respects minsize} -setup {
1922	deleteWindows
1923} -body {
1924    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1925            -orient vertical
1926    foreach w {.f1 .f2 .f3} c {red blue} {
1927	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1928    }
1929
1930    .p sash place 0 0 100
1931
1932    # Get the new sash coord; it should have moved as far as possible while
1933    # respecting minsizes.
1934    .p sash coord 0
1935} -cleanup {
1936	deleteWindows
1937} -result [list 0 40]
1938test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup {
1939	deleteWindows
1940} -body {
1941    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1942            -orient vertical
1943    foreach w {.f1 .f2 .f3} c {red blue} {
1944	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
1945    }
1946
1947    .p sash place 0 0 100
1948
1949    # Get the new sash coord; it should have moved as far as possible while
1950    # respecting minsizes.
1951    .p sash coord 1
1952} -cleanup {
1953	deleteWindows
1954} -result [list 0 62]
1955test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize} -setup {
1956	deleteWindows
1957} -body {
1958    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1959            -orient vertical
1960    foreach w {.f1 .f2 .f3} c {red blue} {
1961	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
1962    }
1963
1964    .p sash place 0 0 100
1965
1966    # Get the new sash coord; it should have moved as far as possible while
1967    # respecting minsizes.
1968    .p sash coord 1
1969} -cleanup {
1970	deleteWindows
1971} -result [list 0 52]
1972test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup {
1973	deleteWindows
1974} -body {
1975    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1976            -orient vertical
1977    foreach w {.f1 .f2 .f3} c {red blue} {
1978	    .p add [frame $w -height 20 -width 20 -bg $c] \
1979		    -sticky nsew -minsize 10 -pady 5
1980    }
1981
1982    .p sash place 0 0 100
1983
1984    # Get the new sash coord; it should have moved as far as possible,
1985    # respecting minsizes.
1986    .p sash coord 0
1987} -cleanup {
1988	deleteWindows
1989} -result [list 0 50]
1990test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup {
1991	deleteWindows
1992} -body {
1993    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
1994            -orient vertical
1995    foreach w {.f1 .f2 .f3} c {red blue} {
1996	    .p add [frame $w -height 20 -width 20 -bg $c] \
1997		    -sticky nsew -minsize -50
1998    }
1999
2000    .p sash place 0 0 50
2001
2002    # Get the new sash coord; it should have moved as far as possible,
2003    # respecting minsizes.
2004    list [.p sash coord 0] [.p sash coord 1]
2005} -cleanup {
2006	deleteWindows
2007} -result [list [list 0 50] [list 0 52]]
2008test panedwindow-18.11 {MoveSash, move up} -setup {
2009	deleteWindows
2010} -body {
2011    set result {}
2012    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2013            -orient vertical
2014    foreach w {.f1 .f2} c {red blue} {
2015	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
2016    }
2017
2018    # Get the requested width of the paned window
2019    lappend result [winfo reqheight .p]
2020
2021    .p sash place 0 0 10
2022
2023    # Get the reqwidth again, to make sure it hasn't changed
2024    lappend result [winfo reqheight .p]
2025
2026    # Check that the sash moved
2027    lappend result [.p sash coord 0]
2028} -cleanup {
2029	deleteWindows
2030} -result [list 42 42 {0 10}]
2031test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup {
2032	deleteWindows
2033} -body {
2034    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2035            -orient vertical
2036    foreach w {.f1 .f2} c {red blue} {
2037	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
2038    }
2039
2040    .p sash place 0 0 -100
2041
2042    # Get the new sash coord; it should be clipped by the reqwidth of
2043    # the panedwindow.
2044    .p sash coord 0
2045} -cleanup {
2046	deleteWindows
2047} -result [list 0 0]
2048test panedwindow-18.13 {MoveSash, move up respects minsize} -setup {
2049	deleteWindows
2050} -body {
2051    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2052            -orient vertical
2053    foreach w {.f1 .f2} c {red blue} {
2054	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
2055    }
2056
2057    .p sash place 0 0 0
2058
2059    # Get the new sash coord; it should have moved as far as possible while
2060    # respecting minsizes.
2061    .p sash coord 0
2062} -cleanup {
2063	deleteWindows
2064} -result [list 0 10]
2065test panedwindow-18.14 {MoveSash, move up respects minsize} -setup {
2066	deleteWindows
2067} -body {
2068    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2069            -orient vertical
2070    foreach w {.f1 .f2 .f3} c {red blue} {
2071	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
2072    }
2073
2074    .p sash place 1 0 0
2075
2076    # Get the new sash coord; it should have moved as far as possible.
2077    .p sash coord 1
2078} -cleanup {
2079	deleteWindows
2080} -result [list 0 22]
2081test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup {
2082	deleteWindows
2083} -body {
2084    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2085            -orient vertical
2086    foreach w {.f1 .f2 .f3} c {red blue} {
2087	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
2088    }
2089
2090    .p sash place 1 0 0
2091
2092    # Get the new sash coord; it should have moved as far as possible while
2093    # respecting minsizes.
2094    .p sash coord 0
2095} -cleanup {
2096	deleteWindows
2097} -result [list 0 0]
2098test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} -setup {
2099	deleteWindows
2100} -body {
2101    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2102            -orient vertical
2103    foreach w {.f1 .f2 .f3} c {red blue} {
2104	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
2105    }
2106
2107    .p sash place 1 0 0
2108
2109    # Get the new sash coord; it should have moved as far as possible while
2110    # respecting minsizes.
2111    .p sash coord 0
2112} -cleanup {
2113	deleteWindows
2114} -result [list 0 10]
2115test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup {
2116	deleteWindows
2117} -body {
2118    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2119            -orient vertical
2120    foreach w {.f1 .f2 .f3} c {red blue} {
2121	    .p add [frame $w -height 20 -width 20 -bg $c] \
2122		    -sticky nsew -minsize 10 -pady 5
2123    }
2124
2125    .p sash place 1 0 0
2126
2127    # Get the new sash coord; it should have moved as far as possible,
2128    # respecting minsizes.
2129    .p sash coord 1
2130} -cleanup {
2131	deleteWindows
2132} -result [list 0 42]
2133test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup {
2134	deleteWindows
2135} -body {
2136    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
2137            -orient vertical
2138    foreach w {.f1 .f2 .f3} c {red blue green} {
2139	    .p add [frame $w -height 20 -width 20 -bg $c] \
2140		    -sticky nsew -minsize -50
2141    }
2142
2143    .p sash place 1 0 10
2144
2145    # Get the new sash coord; it should have moved as far as possible,
2146    # respecting minsizes.
2147    list [.p sash coord 0] [.p sash coord 1]
2148} -cleanup {
2149	deleteWindows
2150} -result [list [list 0 8] [list 0 10]]
2151
2152
2153# The following tests check that the panedwindow is correctly computing its
2154# geometry based on the various configuration options that can affect the
2155# geometry.
2156
2157test panedwindow-19.1 {ComputeGeometry, reqheight taken from widgets} -setup {
2158	deleteWindows
2159} -body {
2160    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
2161    foreach w {.f1 .f2 .f3} {
2162	    .p add [frame $w -width 20 -height 20 -bg blue]
2163    }
2164    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
2165    .f3 configure -height 40
2166    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
2167} -cleanup {
2168	deleteWindows
2169} -result [list [list 60 20] [list 60 40]]
2170
2171test panedwindow-19.2 {ComputeGeometry, reqheight taken from widgets} -setup {
2172	deleteWindows
2173} -body {
2174    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
2175    foreach w {.f1 .f2 .f3} {
2176	    .p add [frame $w -width 20 -height 20 -bg blue]
2177    }
2178    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
2179    .p paneconfigure .f3 -height 40
2180    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
2181} -cleanup {
2182	deleteWindows
2183} -result [list [list 60 20] [list 60 40]]
2184
2185test panedwindow-19.3 {ComputeGeometry, reqheight taken from widgets} -setup {
2186	deleteWindows
2187} -body {
2188    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
2189    foreach w {.f1 .f2 .f3} {
2190	    .p add [frame $w -width 20 -height 20 -bg blue] -pady 20
2191    }
2192    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
2193    .p paneconfigure .f3 -height 40
2194    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
2195} -cleanup {
2196	deleteWindows
2197} -result [list [list 60 60] [list 60 80]]
2198
2199test panedwindow-19.4 {ComputeGeometry, reqwidth taken from widgets} -setup {
2200	deleteWindows
2201} -body {
2202    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
2203            -orient vertical
2204    foreach w {.f1 .f2 .f3} {
2205	.p add [frame $w -width 20 -height 20 -bg blue]
2206    }
2207    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
2208    .f3 configure -width 40
2209    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
2210} -cleanup {
2211	deleteWindows
2212} -result [list [list 20 60] [list 40 60]]
2213
2214test panedwindow-19.5 {ComputeGeometry, reqwidth taken from widgets} -setup {
2215	deleteWindows
2216} -body {
2217    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
2218            -orient vertical
2219    foreach w {.f1 .f2 .f3} {
2220	.p add [frame $w -width 20 -height 20 -bg blue]
2221    }
2222    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
2223    .p paneconfigure .f3 -width 40
2224    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
2225} -cleanup {
2226	deleteWindows
2227} -result [list [list 20 60] [list 40 60]]
2228
2229test panedwindow-19.6 {ComputeGeometry, reqwidth taken from widgets} -setup {
2230	deleteWindows
2231} -body {
2232    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
2233            -orient vertical
2234    foreach w {.f1 .f2 .f3} {
2235	.p add [frame $w -width 20 -height 20 -bg blue] -padx 20
2236    }
2237    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
2238    .p paneconfigure .f3 -width 40
2239    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
2240} -cleanup {
2241	deleteWindows
2242} -result [list [list 60 60] [list 80 60]]
2243
2244test panedwindow-19.7 {ComputeGeometry, one pane, reqsize set properly} -setup {
2245    deleteWindows
2246} -body {
2247    # With just one pane, sashpad and sashwidth should not
2248    # affect the panedwindow's geometry, since no sash should
2249    # ever be drawn.
2250    panedwindow .p -borderwidth 0 -sashpad 0 \
2251        -sashwidth 0 -handlesize 6 -showhandle 0
2252    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
2253    list [winfo reqwidth .p] [winfo reqheight .p]
2254} -cleanup {
2255    deleteWindows
2256} -result {20 20}
2257
2258test panedwindow-19.8 {ComputeGeometry, three panes, reqsize set properly} -setup {
2259    deleteWindows
2260} -body {
2261    panedwindow .p -borderwidth 0 -sashpad 0 \
2262        -sashwidth 0 -handlesize 6 -showhandle 0
2263    foreach w {.p.f1 .p.f2 .p.f3} {
2264        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
2265    }
2266    list [winfo reqwidth .p] [winfo reqheight .p]
2267} -cleanup {
2268    deleteWindows
2269} -result {60 20}
2270
2271test panedwindow-19.9 {ComputeGeometry, sash coords} -setup {
2272    deleteWindows
2273} -body {
2274    panedwindow .p -borderwidth 0 -sashpad 0 \
2275        -sashwidth 0 -handlesize 6 -showhandle 0
2276    foreach w {.f1 .f2 .f3} {
2277        .p add [frame $w -width 20 -height 20 -bg blue] \
2278                            -sticky ""
2279    }
2280    list [.p sash coord 0] [.p sash coord 1]
2281} -cleanup {
2282    deleteWindows
2283} -result {{20 0} {40 0}}
2284
2285test panedwindow-19.10 {ComputeGeometry/ArrangePanes, pane coords} -setup {
2286    deleteWindows
2287} -body {
2288    panedwindow .p -borderwidth 0 -sashpad 0 \
2289        -sashwidth 0 -handlesize 6 -showhandle 0
2290    foreach w {.p.f1 .p.f2 .p.f3} {
2291        .p add [frame $w -width 20 -height 20 -bg blue] \
2292            -sticky nsew -pady 3 -padx 11
2293    }
2294    pack .p
2295    update
2296    set result {}
2297    foreach w {.p.f1 .p.f2 .p.f3} {
2298        lappend result [list [winfo x $w] [winfo y $w] \
2299            [winfo width $w] [winfo height $w]]
2300    }
2301    return $result
2302} -cleanup {
2303    deleteWindows
2304} -result {{11 3 20 20} {53 3 20 20} {95 3 20 20}}
2305
2306test panedwindow-19.11 {ComputeGeometry, one pane, vertical} -setup {
2307    deleteWindows
2308} -body {
2309    # With just one pane, sashpad and sashwidth should not
2310    # affect the panedwindow's geometry, since no sash should
2311    # ever be drawn.
2312    panedwindow .p -borderwidth 0 -sashpad 0 \
2313        -orient vertical -sashwidth 0 -handlesize 6 \
2314        -showhandle 0
2315    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
2316                    -sticky ""
2317    list [winfo reqwidth .p] [winfo reqheight .p]
2318} -cleanup {
2319    deleteWindows
2320} -result {20 20}
2321
2322test panedwindow-19.12 {ComputeGeometry, three panes, vertical} -setup {
2323    deleteWindows
2324} -body {
2325    panedwindow .p -borderwidth 0 -sashpad 0 \
2326        -sashwidth 0 -handlesize 6 -showhandle 0 \
2327        -orient vertical
2328    foreach w {.f1 .f2 .f3} {
2329        .p add [frame $w -width 20 -height 20 -bg blue] \
2330                            -sticky ""
2331    }
2332    list [winfo reqwidth .p] [winfo reqheight .p]
2333} -cleanup {
2334    deleteWindows
2335} -result {20 60}
2336
2337test panedwindow-19.13 {ComputeGeometry, sash coords, vertical} -setup {
2338    deleteWindows
2339} -body {
2340    panedwindow .p -borderwidth 0 -sashpad 0 \
2341        -sashwidth 0 -handlesize 6 -showhandle 0 \
2342        -orient vertical
2343    foreach w {.f1 .f2 .f3} {
2344        .p add [frame $w -width 20 -height 20 -bg blue] \
2345                            -sticky ""
2346    }
2347    list [.p sash coord 0] [.p sash coord 1]
2348} -cleanup {
2349    deleteWindows
2350} -result {{0 20} {0 40}}
2351
2352test panedwindow-19.14 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
2353    deleteWindows
2354} -body {
2355    panedwindow .p -borderwidth 0 -sashpad 0 \
2356        -sashwidth 0 -handlesize 6 -showhandle 0 \
2357        -orient vertical
2358    foreach w {.p.f1 .p.f2 .p.f3} {
2359        .p add [frame $w -width 20 -height 20 -bg blue] \
2360            -sticky nsew -pady 11 -padx 3
2361    }
2362    pack .p
2363    update
2364    set result {}
2365    foreach w {.p.f1 .p.f2 .p.f3} {
2366        lappend result [list [winfo x $w] [winfo y $w] \
2367            [winfo width $w] [winfo height $w]]
2368        }
2369    return $result
2370} -cleanup {
2371    deleteWindows
2372} -result {{3 11 20 20} {3 53 20 20} {3 95 20 20}}
2373test panedwindow-19.15 {ComputeGeometry, one pane, reqsize set properly} -setup {
2374    deleteWindows
2375} -body {
2376    # With just one pane, sashpad and sashwidth should not
2377    # affect the panedwindow's geometry, since no sash should
2378    # ever be drawn.
2379    panedwindow .p -borderwidth 0 -sashpad 0 \
2380        -sashwidth 0 -handlesize 6 -showhandle 1
2381    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
2382    list [winfo reqwidth .p] [winfo reqheight .p]
2383} -cleanup {
2384    deleteWindows
2385} -result {22 20}
2386
2387test panedwindow-19.16 {ComputeGeometry, three panes, reqsize set properly} -setup {
2388    deleteWindows
2389} -body {
2390    panedwindow .p -borderwidth 0 -sashpad 0 \
2391        -sashwidth 0 -handlesize 6 -showhandle 1
2392    foreach w {.p.f1 .p.f2 .p.f3} {
2393        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
2394    }
2395    list [winfo reqwidth .p] [winfo reqheight .p]
2396} -cleanup {
2397    deleteWindows
2398} -result {72 20}
2399
2400test panedwindow-19.17 {ComputeGeometry, sash coords} -setup {
2401    deleteWindows
2402} -body {
2403    panedwindow .p -borderwidth 0 -sashpad 0 \
2404        -sashwidth 0 -handlesize 6 -showhandle 1
2405    foreach w {.f1 .f2 .f3} {
2406        .p add [frame $w -width 20 -height 20 -bg blue] \
2407                            -sticky ""
2408    }
2409    list [.p sash coord 0] [.p sash coord 1]
2410} -cleanup {
2411    deleteWindows
2412} -result {{23 0} {49 0}}
2413
2414test panedwindow-19.18 {ComputeGeometry/ArrangePanes, pane coords} -setup {
2415    deleteWindows
2416} -body {
2417    panedwindow .p -borderwidth 0 -sashpad 0 \
2418        -sashwidth 0 -handlesize 6 -showhandle 1
2419    foreach w {.p.f1 .p.f2 .p.f3} {
2420        .p add [frame $w -width 20 -height 20 -bg blue] \
2421            -sticky nsew -pady 3 -padx 11
2422    }
2423    pack .p
2424    update
2425    set result {}
2426    foreach w {.p.f1 .p.f2 .p.f3} {
2427        lappend result [list [winfo x $w] [winfo y $w] \
2428            [winfo width $w] [winfo height $w]]
2429    }
2430    return $result
2431} -cleanup {
2432    deleteWindows
2433} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}}
2434
2435test panedwindow-19.19 {ComputeGeometry, one pane, vertical} -setup {
2436    deleteWindows
2437} -body {
2438    # With just one pane, sashpad and sashwidth should not
2439    # affect the panedwindow's geometry, since no sash should
2440    # ever be drawn.
2441    panedwindow .p -borderwidth 0 -sashpad 0 \
2442        -orient vertical -sashwidth 0 -handlesize 6 \
2443        -showhandle 1
2444    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
2445                    -sticky ""
2446    list [winfo reqwidth .p] [winfo reqheight .p]
2447} -cleanup {
2448    deleteWindows
2449} -result {20 22}
2450
2451test panedwindow-19.20 {ComputeGeometry, three panes, vertical} -setup {
2452    deleteWindows
2453} -body {
2454    panedwindow .p -borderwidth 0 -sashpad 0 \
2455        -sashwidth 0 -handlesize 6 -showhandle 1 \
2456        -orient vertical
2457    foreach w {.f1 .f2 .f3} {
2458        .p add [frame $w -width 20 -height 20 -bg blue] \
2459                            -sticky ""
2460    }
2461    list [winfo reqwidth .p] [winfo reqheight .p]
2462} -cleanup {
2463    deleteWindows
2464} -result {20 72}
2465
2466test panedwindow-19.21 {ComputeGeometry, sash coords, vertical} -setup {
2467    deleteWindows
2468} -body {
2469    panedwindow .p -borderwidth 0 -sashpad 0 \
2470        -sashwidth 0 -handlesize 6 -showhandle 1 \
2471        -orient vertical
2472    foreach w {.f1 .f2 .f3} {
2473        .p add [frame $w -width 20 -height 20 -bg blue] \
2474                            -sticky ""
2475    }
2476    list [.p sash coord 0] [.p sash coord 1]
2477} -cleanup {
2478    deleteWindows
2479} -result {{0 23} {0 49}}
2480
2481test panedwindow-19.22 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
2482    deleteWindows
2483} -body {
2484    panedwindow .p -borderwidth 0 -sashpad 0 \
2485        -sashwidth 0 -handlesize 6 -showhandle 1 \
2486        -orient vertical
2487    foreach w {.p.f1 .p.f2 .p.f3} {
2488        .p add [frame $w -width 20 -height 20 -bg blue] \
2489            -sticky nsew -pady 11 -padx 3
2490    }
2491    pack .p
2492    update
2493    set result {}
2494    foreach w {.p.f1 .p.f2 .p.f3} {
2495        lappend result [list [winfo x $w] [winfo y $w] \
2496            [winfo width $w] [winfo height $w]]
2497        }
2498    return $result
2499} -cleanup {
2500    deleteWindows
2501} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}}
2502test panedwindow-19.23 {ComputeGeometry, one pane, reqsize set properly} -setup {
2503    deleteWindows
2504} -body {
2505    # With just one pane, sashpad and sashwidth should not
2506    # affect the panedwindow's geometry, since no sash should
2507    # ever be drawn.
2508    panedwindow .p -borderwidth 0 -sashpad 0 \
2509        -sashwidth 3 -handlesize 6 -showhandle 0
2510    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
2511    list [winfo reqwidth .p] [winfo reqheight .p]
2512} -cleanup {
2513    deleteWindows
2514} -result {20 20}
2515
2516test panedwindow-19.24 {ComputeGeometry, three panes, reqsize set properly} -setup {
2517    deleteWindows
2518} -body {
2519    panedwindow .p -borderwidth 0 -sashpad 0 \
2520        -sashwidth 3 -handlesize 6 -showhandle 0
2521    foreach w {.p.f1 .p.f2 .p.f3} {
2522        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
2523    }
2524    list [winfo reqwidth .p] [winfo reqheight .p]
2525} -cleanup {
2526    deleteWindows
2527} -result {66 20}
2528
2529test panedwindow-19.25 {ComputeGeometry, sash coords} -setup {
2530    deleteWindows
2531} -body {
2532    panedwindow .p -borderwidth 0 -sashpad 0 \
2533        -sashwidth 3 -handlesize 6 -showhandle 0
2534    foreach w {.f1 .f2 .f3} {
2535        .p add [frame $w -width 20 -height 20 -bg blue] \
2536                            -sticky ""
2537    }
2538    list [.p sash coord 0] [.p sash coord 1]
2539} -cleanup {
2540    deleteWindows
2541} -result {{20 0} {43 0}}
2542
2543test panedwindow-19.26 {ComputeGeometry/ArrangePanes, pane coords} -setup {
2544    deleteWindows
2545} -body {
2546    panedwindow .p -borderwidth 0 -sashpad 0 \
2547        -sashwidth 3 -handlesize 6 -showhandle 0
2548    foreach w {.p.f1 .p.f2 .p.f3} {
2549        .p add [frame $w -width 20 -height 20 -bg blue] \
2550            -sticky nsew -pady 3 -padx 11
2551    }
2552    pack .p
2553    update
2554    set result {}
2555    foreach w {.p.f1 .p.f2 .p.f3} {
2556        lappend result [list [winfo x $w] [winfo y $w] \
2557            [winfo width $w] [winfo height $w]]
2558    }
2559    return $result
2560} -cleanup {
2561    deleteWindows
2562} -result {{11 3 20 20} {56 3 20 20} {101 3 20 20}}
2563
2564test panedwindow-19.27 {ComputeGeometry, one pane, vertical} -setup {
2565    deleteWindows
2566} -body {
2567    # With just one pane, sashpad and sashwidth should not
2568    # affect the panedwindow's geometry, since no sash should
2569    # ever be drawn.
2570    panedwindow .p -borderwidth 0 -sashpad 0 \
2571        -orient vertical -sashwidth 3 -handlesize 6 \
2572        -showhandle 0
2573    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
2574                    -sticky ""
2575    list [winfo reqwidth .p] [winfo reqheight .p]
2576} -cleanup {
2577    deleteWindows
2578} -result {20 20}
2579
2580test panedwindow-19.28 {ComputeGeometry, three panes, vertical} -setup {
2581    deleteWindows
2582} -body {
2583    panedwindow .p -borderwidth 0 -sashpad 0 \
2584        -sashwidth 3 -handlesize 6 -showhandle 0 \
2585        -orient vertical
2586    foreach w {.f1 .f2 .f3} {
2587        .p add [frame $w -width 20 -height 20 -bg blue] \
2588                            -sticky ""
2589    }
2590    list [winfo reqwidth .p] [winfo reqheight .p]
2591} -cleanup {
2592    deleteWindows
2593} -result {20 66}
2594
2595test panedwindow-19.29 {ComputeGeometry, sash coords, vertical} -setup {
2596    deleteWindows
2597} -body {
2598    panedwindow .p -borderwidth 0 -sashpad 0 \
2599        -sashwidth 3 -handlesize 6 -showhandle 0 \
2600        -orient vertical
2601    foreach w {.f1 .f2 .f3} {
2602        .p add [frame $w -width 20 -height 20 -bg blue] \
2603                            -sticky ""
2604    }
2605    list [.p sash coord 0] [.p sash coord 1]
2606} -cleanup {
2607    deleteWindows
2608} -result {{0 20} {0 43}}
2609
2610test panedwindow-19.30 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
2611    deleteWindows
2612} -body {
2613    panedwindow .p -borderwidth 0 -sashpad 0 \
2614        -sashwidth 3 -handlesize 6 -showhandle 0 \
2615        -orient vertical
2616    foreach w {.p.f1 .p.f2 .p.f3} {
2617        .p add [frame $w -width 20 -height 20 -bg blue] \
2618            -sticky nsew -pady 11 -padx 3
2619    }
2620    pack .p
2621    update
2622    set result {}
2623    foreach w {.p.f1 .p.f2 .p.f3} {
2624        lappend result [list [winfo x $w] [winfo y $w] \
2625            [winfo width $w] [winfo height $w]]
2626        }
2627    return $result
2628} -cleanup {
2629    deleteWindows
2630} -result {{3 11 20 20} {3 56 20 20} {3 101 20 20}}
2631test panedwindow-19.31 {ComputeGeometry, one pane, reqsize set properly} -setup {
2632    deleteWindows
2633} -body {
2634    # With just one pane, sashpad and sashwidth should not
2635    # affect the panedwindow's geometry, since no sash should
2636    # ever be drawn.
2637    panedwindow .p -borderwidth 0 -sashpad 0 \
2638        -sashwidth 3 -handlesize 6 -showhandle 1
2639    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
2640    list [winfo reqwidth .p] [winfo reqheight .p]
2641} -cleanup {
2642    deleteWindows
2643} -result {22 20}
2644
2645test panedwindow-19.32 {ComputeGeometry, three panes, reqsize set properly} -setup {
2646    deleteWindows
2647} -body {
2648    panedwindow .p -borderwidth 0 -sashpad 0 \
2649        -sashwidth 3 -handlesize 6 -showhandle 1
2650    foreach w {.p.f1 .p.f2 .p.f3} {
2651        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
2652    }
2653    list [winfo reqwidth .p] [winfo reqheight .p]
2654} -cleanup {
2655    deleteWindows
2656} -result {72 20}
2657
2658test panedwindow-19.33 {ComputeGeometry, sash coords} -setup {
2659    deleteWindows
2660} -body {
2661    panedwindow .p -borderwidth 0 -sashpad 0 \
2662        -sashwidth 3 -handlesize 6 -showhandle 1
2663    foreach w {.f1 .f2 .f3} {
2664        .p add [frame $w -width 20 -height 20 -bg blue] \
2665                            -sticky ""
2666    }
2667    list [.p sash coord 0] [.p sash coord 1]
2668} -cleanup {
2669    deleteWindows
2670} -result {{21 0} {47 0}}
2671
2672test panedwindow-19.34 {ComputeGeometry/ArrangePanes, pane coords} -setup {
2673    deleteWindows
2674} -body {
2675    panedwindow .p -borderwidth 0 -sashpad 0 \
2676        -sashwidth 3 -handlesize 6 -showhandle 1
2677    foreach w {.p.f1 .p.f2 .p.f3} {
2678        .p add [frame $w -width 20 -height 20 -bg blue] \
2679            -sticky nsew -pady 3 -padx 11
2680    }
2681    pack .p
2682    update
2683    set result {}
2684    foreach w {.p.f1 .p.f2 .p.f3} {
2685        lappend result [list [winfo x $w] [winfo y $w] \
2686            [winfo width $w] [winfo height $w]]
2687    }
2688    return $result
2689} -cleanup {
2690    deleteWindows
2691} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}}
2692
2693test panedwindow-19.35 {ComputeGeometry, one pane, vertical} -setup {
2694    deleteWindows
2695} -body {
2696    # With just one pane, sashpad and sashwidth should not
2697    # affect the panedwindow's geometry, since no sash should
2698    # ever be drawn.
2699    panedwindow .p -borderwidth 0 -sashpad 0 \
2700        -orient vertical -sashwidth 3 -handlesize 6 \
2701        -showhandle 1
2702    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
2703                    -sticky ""
2704    list [winfo reqwidth .p] [winfo reqheight .p]
2705} -cleanup {
2706    deleteWindows
2707} -result {20 22}
2708
2709test panedwindow-19.36 {ComputeGeometry, three panes, vertical} -setup {
2710    deleteWindows
2711} -body {
2712    panedwindow .p -borderwidth 0 -sashpad 0 \
2713        -sashwidth 3 -handlesize 6 -showhandle 1 \
2714        -orient vertical
2715    foreach w {.f1 .f2 .f3} {
2716        .p add [frame $w -width 20 -height 20 -bg blue] \
2717                            -sticky ""
2718    }
2719    list [winfo reqwidth .p] [winfo reqheight .p]
2720} -cleanup {
2721    deleteWindows
2722} -result {20 72}
2723
2724test panedwindow-19.37 {ComputeGeometry, sash coords, vertical} -setup {
2725    deleteWindows
2726} -body {
2727    panedwindow .p -borderwidth 0 -sashpad 0 \
2728        -sashwidth 3 -handlesize 6 -showhandle 1 \
2729        -orient vertical
2730    foreach w {.f1 .f2 .f3} {
2731        .p add [frame $w -width 20 -height 20 -bg blue] \
2732                            -sticky ""
2733    }
2734    list [.p sash coord 0] [.p sash coord 1]
2735} -cleanup {
2736    deleteWindows
2737} -result {{0 21} {0 47}}
2738
2739test panedwindow-19.38 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
2740    deleteWindows
2741} -body {
2742    panedwindow .p -borderwidth 0 -sashpad 0 \
2743        -sashwidth 3 -handlesize 6 -showhandle 1 \
2744        -orient vertical
2745    foreach w {.p.f1 .p.f2 .p.f3} {
2746        .p add [frame $w -width 20 -height 20 -bg blue] \
2747            -sticky nsew -pady 11 -padx 3
2748    }
2749    pack .p
2750    update
2751    set result {}
2752    foreach w {.p.f1 .p.f2 .p.f3} {
2753        lappend result [list [winfo x $w] [winfo y $w] \
2754            [winfo width $w] [winfo height $w]]
2755        }
2756    return $result
2757} -cleanup {
2758    deleteWindows
2759} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}}
2760test panedwindow-19.39 {ComputeGeometry, one pane, reqsize set properly} -setup {
2761    deleteWindows
2762} -body {
2763    # With just one pane, sashpad and sashwidth should not
2764    # affect the panedwindow's geometry, since no sash should
2765    # ever be drawn.
2766    panedwindow .p -borderwidth 0 -sashpad 5 \
2767        -sashwidth 0 -handlesize 6 -showhandle 0
2768    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
2769    list [winfo reqwidth .p] [winfo reqheight .p]
2770} -cleanup {
2771    deleteWindows
2772} -result {20 20}
2773
2774test panedwindow-19.40 {ComputeGeometry, three panes, reqsize set properly} -setup {
2775    deleteWindows
2776} -body {
2777    panedwindow .p -borderwidth 0 -sashpad 5 \
2778        -sashwidth 0 -handlesize 6 -showhandle 0
2779    foreach w {.p.f1 .p.f2 .p.f3} {
2780        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
2781    }
2782    list [winfo reqwidth .p] [winfo reqheight .p]
2783} -cleanup {
2784    deleteWindows
2785} -result {80 20}
2786
2787test panedwindow-19.41 {ComputeGeometry, sash coords} -setup {
2788    deleteWindows
2789} -body {
2790    panedwindow .p -borderwidth 0 -sashpad 5 \
2791        -sashwidth 0 -handlesize 6 -showhandle 0
2792    foreach w {.f1 .f2 .f3} {
2793        .p add [frame $w -width 20 -height 20 -bg blue] \
2794                            -sticky ""
2795    }
2796    list [.p sash coord 0] [.p sash coord 1]
2797} -cleanup {
2798    deleteWindows
2799} -result {{25 0} {55 0}}
2800
2801test panedwindow-19.42 {ComputeGeometry/ArrangePanes, pane coords} -setup {
2802    deleteWindows
2803} -body {
2804    panedwindow .p -borderwidth 0 -sashpad 5 \
2805        -sashwidth 0 -handlesize 6 -showhandle 0
2806    foreach w {.p.f1 .p.f2 .p.f3} {
2807        .p add [frame $w -width 20 -height 20 -bg blue] \
2808            -sticky nsew -pady 3 -padx 11
2809    }
2810    pack .p
2811    update
2812    set result {}
2813    foreach w {.p.f1 .p.f2 .p.f3} {
2814        lappend result [list [winfo x $w] [winfo y $w] \
2815            [winfo width $w] [winfo height $w]]
2816    }
2817    return $result
2818} -cleanup {
2819    deleteWindows
2820} -result {{11 3 20 20} {63 3 20 20} {115 3 20 20}}
2821
2822test panedwindow-19.43 {ComputeGeometry, one pane, vertical} -setup {
2823    deleteWindows
2824} -body {
2825    # With just one pane, sashpad and sashwidth should not
2826    # affect the panedwindow's geometry, since no sash should
2827    # ever be drawn.
2828    panedwindow .p -borderwidth 0 -sashpad 5 \
2829        -orient vertical -sashwidth 0 -handlesize 6 \
2830        -showhandle 0
2831    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
2832                    -sticky ""
2833    list [winfo reqwidth .p] [winfo reqheight .p]
2834} -cleanup {
2835    deleteWindows
2836} -result {20 20}
2837
2838test panedwindow-19.44 {ComputeGeometry, three panes, vertical} -setup {
2839    deleteWindows
2840} -body {
2841    panedwindow .p -borderwidth 0 -sashpad 5 \
2842        -sashwidth 0 -handlesize 6 -showhandle 0 \
2843        -orient vertical
2844    foreach w {.f1 .f2 .f3} {
2845        .p add [frame $w -width 20 -height 20 -bg blue] \
2846                            -sticky ""
2847    }
2848    list [winfo reqwidth .p] [winfo reqheight .p]
2849} -cleanup {
2850    deleteWindows
2851} -result {20 80}
2852
2853test panedwindow-19.45 {ComputeGeometry, sash coords, vertical} -setup {
2854    deleteWindows
2855} -body {
2856    panedwindow .p -borderwidth 0 -sashpad 5 \
2857        -sashwidth 0 -handlesize 6 -showhandle 0 \
2858        -orient vertical
2859    foreach w {.f1 .f2 .f3} {
2860        .p add [frame $w -width 20 -height 20 -bg blue] \
2861                            -sticky ""
2862    }
2863    list [.p sash coord 0] [.p sash coord 1]
2864} -cleanup {
2865    deleteWindows
2866} -result {{0 25} {0 55}}
2867
2868test panedwindow-19.46 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
2869    deleteWindows
2870} -body {
2871    panedwindow .p -borderwidth 0 -sashpad 5 \
2872        -sashwidth 0 -handlesize 6 -showhandle 0 \
2873        -orient vertical
2874    foreach w {.p.f1 .p.f2 .p.f3} {
2875        .p add [frame $w -width 20 -height 20 -bg blue] \
2876            -sticky nsew -pady 11 -padx 3
2877    }
2878    pack .p
2879    update
2880    set result {}
2881    foreach w {.p.f1 .p.f2 .p.f3} {
2882        lappend result [list [winfo x $w] [winfo y $w] \
2883            [winfo width $w] [winfo height $w]]
2884        }
2885    return $result
2886} -cleanup {
2887    deleteWindows
2888} -result {{3 11 20 20} {3 63 20 20} {3 115 20 20}}
2889test panedwindow-19.47 {ComputeGeometry, one pane, reqsize set properly} -setup {
2890    deleteWindows
2891} -body {
2892    # With just one pane, sashpad and sashwidth should not
2893    # affect the panedwindow's geometry, since no sash should
2894    # ever be drawn.
2895    panedwindow .p -borderwidth 0 -sashpad 5 \
2896        -sashwidth 0 -handlesize 6 -showhandle 1
2897    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
2898    list [winfo reqwidth .p] [winfo reqheight .p]
2899} -cleanup {
2900    deleteWindows
2901} -result {22 20}
2902
2903test panedwindow-19.48 {ComputeGeometry, three panes, reqsize set properly} -setup {
2904    deleteWindows
2905} -body {
2906    panedwindow .p -borderwidth 0 -sashpad 5 \
2907        -sashwidth 0 -handlesize 6 -showhandle 1
2908    foreach w {.p.f1 .p.f2 .p.f3} {
2909        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
2910    }
2911    list [winfo reqwidth .p] [winfo reqheight .p]
2912} -cleanup {
2913    deleteWindows
2914} -result {92 20}
2915
2916test panedwindow-19.49 {ComputeGeometry, sash coords} -setup {
2917    deleteWindows
2918} -body {
2919    panedwindow .p -borderwidth 0 -sashpad 5 \
2920        -sashwidth 0 -handlesize 6 -showhandle 1
2921    foreach w {.f1 .f2 .f3} {
2922        .p add [frame $w -width 20 -height 20 -bg blue] \
2923                            -sticky ""
2924    }
2925    list [.p sash coord 0] [.p sash coord 1]
2926} -cleanup {
2927    deleteWindows
2928} -result {{28 0} {64 0}}
2929
2930test panedwindow-19.50 {ComputeGeometry/ArrangePanes, pane coords} -setup {
2931    deleteWindows
2932} -body {
2933    panedwindow .p -borderwidth 0 -sashpad 5 \
2934        -sashwidth 0 -handlesize 6 -showhandle 1
2935    foreach w {.p.f1 .p.f2 .p.f3} {
2936        .p add [frame $w -width 20 -height 20 -bg blue] \
2937            -sticky nsew -pady 3 -padx 11
2938    }
2939    pack .p
2940    update
2941    set result {}
2942    foreach w {.p.f1 .p.f2 .p.f3} {
2943        lappend result [list [winfo x $w] [winfo y $w] \
2944            [winfo width $w] [winfo height $w]]
2945    }
2946    return $result
2947} -cleanup {
2948    deleteWindows
2949} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}}
2950
2951test panedwindow-19.51 {ComputeGeometry, one pane, vertical} -setup {
2952    deleteWindows
2953} -body {
2954    # With just one pane, sashpad and sashwidth should not
2955    # affect the panedwindow's geometry, since no sash should
2956    # ever be drawn.
2957    panedwindow .p -borderwidth 0 -sashpad 5 \
2958        -orient vertical -sashwidth 0 -handlesize 6 \
2959        -showhandle 1
2960    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
2961                    -sticky ""
2962    list [winfo reqwidth .p] [winfo reqheight .p]
2963} -cleanup {
2964    deleteWindows
2965} -result {20 22}
2966
2967test panedwindow-19.52 {ComputeGeometry, three panes, vertical} -setup {
2968    deleteWindows
2969} -body {
2970    panedwindow .p -borderwidth 0 -sashpad 5 \
2971        -sashwidth 0 -handlesize 6 -showhandle 1 \
2972        -orient vertical
2973    foreach w {.f1 .f2 .f3} {
2974        .p add [frame $w -width 20 -height 20 -bg blue] \
2975                            -sticky ""
2976    }
2977    list [winfo reqwidth .p] [winfo reqheight .p]
2978} -cleanup {
2979    deleteWindows
2980} -result {20 92}
2981
2982test panedwindow-19.53 {ComputeGeometry, sash coords, vertical} -setup {
2983    deleteWindows
2984} -body {
2985    panedwindow .p -borderwidth 0 -sashpad 5 \
2986        -sashwidth 0 -handlesize 6 -showhandle 1 \
2987        -orient vertical
2988    foreach w {.f1 .f2 .f3} {
2989        .p add [frame $w -width 20 -height 20 -bg blue] \
2990                            -sticky ""
2991    }
2992    list [.p sash coord 0] [.p sash coord 1]
2993} -cleanup {
2994    deleteWindows
2995} -result {{0 28} {0 64}}
2996
2997test panedwindow-19.54 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
2998    deleteWindows
2999} -body {
3000    panedwindow .p -borderwidth 0 -sashpad 5 \
3001        -sashwidth 0 -handlesize 6 -showhandle 1 \
3002        -orient vertical
3003    foreach w {.p.f1 .p.f2 .p.f3} {
3004        .p add [frame $w -width 20 -height 20 -bg blue] \
3005            -sticky nsew -pady 11 -padx 3
3006    }
3007    pack .p
3008    update
3009    set result {}
3010    foreach w {.p.f1 .p.f2 .p.f3} {
3011        lappend result [list [winfo x $w] [winfo y $w] \
3012            [winfo width $w] [winfo height $w]]
3013        }
3014    return $result
3015} -cleanup {
3016    deleteWindows
3017} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}}
3018test panedwindow-19.55 {ComputeGeometry, one pane, reqsize set properly} -setup {
3019    deleteWindows
3020} -body {
3021    # With just one pane, sashpad and sashwidth should not
3022    # affect the panedwindow's geometry, since no sash should
3023    # ever be drawn.
3024    panedwindow .p -borderwidth 0 -sashpad 5 \
3025        -sashwidth 3 -handlesize 6 -showhandle 0
3026    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
3027    list [winfo reqwidth .p] [winfo reqheight .p]
3028} -cleanup {
3029    deleteWindows
3030} -result {20 20}
3031
3032test panedwindow-19.56 {ComputeGeometry, three panes, reqsize set properly} -setup {
3033    deleteWindows
3034} -body {
3035    panedwindow .p -borderwidth 0 -sashpad 5 \
3036        -sashwidth 3 -handlesize 6 -showhandle 0
3037    foreach w {.p.f1 .p.f2 .p.f3} {
3038        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3039    }
3040    list [winfo reqwidth .p] [winfo reqheight .p]
3041} -cleanup {
3042    deleteWindows
3043} -result {86 20}
3044
3045test panedwindow-19.57 {ComputeGeometry, sash coords} -setup {
3046    deleteWindows
3047} -body {
3048    panedwindow .p -borderwidth 0 -sashpad 5 \
3049        -sashwidth 3 -handlesize 6 -showhandle 0
3050    foreach w {.f1 .f2 .f3} {
3051        .p add [frame $w -width 20 -height 20 -bg blue] \
3052                            -sticky ""
3053    }
3054    list [.p sash coord 0] [.p sash coord 1]
3055} -cleanup {
3056    deleteWindows
3057} -result {{25 0} {58 0}}
3058
3059test panedwindow-19.58 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3060    deleteWindows
3061} -body {
3062    panedwindow .p -borderwidth 0 -sashpad 5 \
3063        -sashwidth 3 -handlesize 6 -showhandle 0
3064    foreach w {.p.f1 .p.f2 .p.f3} {
3065        .p add [frame $w -width 20 -height 20 -bg blue] \
3066            -sticky nsew -pady 3 -padx 11
3067    }
3068    pack .p
3069    update
3070    set result {}
3071    foreach w {.p.f1 .p.f2 .p.f3} {
3072        lappend result [list [winfo x $w] [winfo y $w] \
3073            [winfo width $w] [winfo height $w]]
3074    }
3075    return $result
3076} -cleanup {
3077    deleteWindows
3078} -result {{11 3 20 20} {66 3 20 20} {121 3 20 20}}
3079
3080test panedwindow-19.59 {ComputeGeometry, one pane, vertical} -setup {
3081    deleteWindows
3082} -body {
3083    # With just one pane, sashpad and sashwidth should not
3084    # affect the panedwindow's geometry, since no sash should
3085    # ever be drawn.
3086    panedwindow .p -borderwidth 0 -sashpad 5 \
3087        -orient vertical -sashwidth 3 -handlesize 6 \
3088        -showhandle 0
3089    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
3090                    -sticky ""
3091    list [winfo reqwidth .p] [winfo reqheight .p]
3092} -cleanup {
3093    deleteWindows
3094} -result {20 20}
3095
3096test panedwindow-19.60 {ComputeGeometry, three panes, vertical} -setup {
3097    deleteWindows
3098} -body {
3099    panedwindow .p -borderwidth 0 -sashpad 5 \
3100        -sashwidth 3 -handlesize 6 -showhandle 0 \
3101        -orient vertical
3102    foreach w {.f1 .f2 .f3} {
3103        .p add [frame $w -width 20 -height 20 -bg blue] \
3104                            -sticky ""
3105    }
3106    list [winfo reqwidth .p] [winfo reqheight .p]
3107} -cleanup {
3108    deleteWindows
3109} -result {20 86}
3110
3111test panedwindow-19.61 {ComputeGeometry, sash coords, vertical} -setup {
3112    deleteWindows
3113} -body {
3114    panedwindow .p -borderwidth 0 -sashpad 5 \
3115        -sashwidth 3 -handlesize 6 -showhandle 0 \
3116        -orient vertical
3117    foreach w {.f1 .f2 .f3} {
3118        .p add [frame $w -width 20 -height 20 -bg blue] \
3119                            -sticky ""
3120    }
3121    list [.p sash coord 0] [.p sash coord 1]
3122} -cleanup {
3123    deleteWindows
3124} -result {{0 25} {0 58}}
3125
3126test panedwindow-19.62 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
3127    deleteWindows
3128} -body {
3129    panedwindow .p -borderwidth 0 -sashpad 5 \
3130        -sashwidth 3 -handlesize 6 -showhandle 0 \
3131        -orient vertical
3132    foreach w {.p.f1 .p.f2 .p.f3} {
3133        .p add [frame $w -width 20 -height 20 -bg blue] \
3134            -sticky nsew -pady 11 -padx 3
3135    }
3136    pack .p
3137    update
3138    set result {}
3139    foreach w {.p.f1 .p.f2 .p.f3} {
3140        lappend result [list [winfo x $w] [winfo y $w] \
3141            [winfo width $w] [winfo height $w]]
3142        }
3143    return $result
3144} -cleanup {
3145    deleteWindows
3146} -result {{3 11 20 20} {3 66 20 20} {3 121 20 20}}
3147test panedwindow-19.63 {ComputeGeometry, one pane, reqsize set properly} -setup {
3148    deleteWindows
3149} -body {
3150    # With just one pane, sashpad and sashwidth should not
3151    # affect the panedwindow's geometry, since no sash should
3152    # ever be drawn.
3153    panedwindow .p -borderwidth 0 -sashpad 5 \
3154        -sashwidth 3 -handlesize 6 -showhandle 1
3155    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
3156    list [winfo reqwidth .p] [winfo reqheight .p]
3157} -cleanup {
3158    deleteWindows
3159} -result {22 20}
3160
3161test panedwindow-19.64 {ComputeGeometry, three panes, reqsize set properly} -setup {
3162    deleteWindows
3163} -body {
3164    panedwindow .p -borderwidth 0 -sashpad 5 \
3165        -sashwidth 3 -handlesize 6 -showhandle 1
3166    foreach w {.p.f1 .p.f2 .p.f3} {
3167        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3168    }
3169    list [winfo reqwidth .p] [winfo reqheight .p]
3170} -cleanup {
3171    deleteWindows
3172} -result {92 20}
3173
3174test panedwindow-19.65 {ComputeGeometry, sash coords} -setup {
3175    deleteWindows
3176} -body {
3177    panedwindow .p -borderwidth 0 -sashpad 5 \
3178        -sashwidth 3 -handlesize 6 -showhandle 1
3179    foreach w {.f1 .f2 .f3} {
3180        .p add [frame $w -width 20 -height 20 -bg blue] \
3181                            -sticky ""
3182    }
3183    list [.p sash coord 0] [.p sash coord 1]
3184} -cleanup {
3185    deleteWindows
3186} -result {{26 0} {62 0}}
3187
3188test panedwindow-19.66 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3189    deleteWindows
3190} -body {
3191    panedwindow .p -borderwidth 0 -sashpad 5 \
3192        -sashwidth 3 -handlesize 6 -showhandle 1
3193    foreach w {.p.f1 .p.f2 .p.f3} {
3194        .p add [frame $w -width 20 -height 20 -bg blue] \
3195            -sticky nsew -pady 3 -padx 11
3196    }
3197    pack .p
3198    update
3199    set result {}
3200    foreach w {.p.f1 .p.f2 .p.f3} {
3201        lappend result [list [winfo x $w] [winfo y $w] \
3202            [winfo width $w] [winfo height $w]]
3203    }
3204    return $result
3205} -cleanup {
3206    deleteWindows
3207} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}}
3208
3209test panedwindow-19.67 {ComputeGeometry, one pane, vertical} -setup {
3210    deleteWindows
3211} -body {
3212    # With just one pane, sashpad and sashwidth should not
3213    # affect the panedwindow's geometry, since no sash should
3214    # ever be drawn.
3215    panedwindow .p -borderwidth 0 -sashpad 5 \
3216        -orient vertical -sashwidth 3 -handlesize 6 \
3217        -showhandle 1
3218    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
3219                    -sticky ""
3220    list [winfo reqwidth .p] [winfo reqheight .p]
3221} -cleanup {
3222    deleteWindows
3223} -result {20 22}
3224
3225test panedwindow-19.68 {ComputeGeometry, three panes, vertical} -setup {
3226    deleteWindows
3227} -body {
3228    panedwindow .p -borderwidth 0 -sashpad 5 \
3229        -sashwidth 3 -handlesize 6 -showhandle 1 \
3230        -orient vertical
3231    foreach w {.f1 .f2 .f3} {
3232        .p add [frame $w -width 20 -height 20 -bg blue] \
3233                            -sticky ""
3234    }
3235    list [winfo reqwidth .p] [winfo reqheight .p]
3236} -cleanup {
3237    deleteWindows
3238} -result {20 92}
3239
3240test panedwindow-19.69 {ComputeGeometry, sash coords, vertical} -setup {
3241    deleteWindows
3242} -body {
3243    panedwindow .p -borderwidth 0 -sashpad 5 \
3244        -sashwidth 3 -handlesize 6 -showhandle 1 \
3245        -orient vertical
3246    foreach w {.f1 .f2 .f3} {
3247        .p add [frame $w -width 20 -height 20 -bg blue] \
3248                            -sticky ""
3249    }
3250    list [.p sash coord 0] [.p sash coord 1]
3251} -cleanup {
3252    deleteWindows
3253} -result {{0 26} {0 62}}
3254
3255test panedwindow-19.70 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
3256    deleteWindows
3257} -body {
3258    panedwindow .p -borderwidth 0 -sashpad 5 \
3259        -sashwidth 3 -handlesize 6 -showhandle 1 \
3260        -orient vertical
3261    foreach w {.p.f1 .p.f2 .p.f3} {
3262        .p add [frame $w -width 20 -height 20 -bg blue] \
3263            -sticky nsew -pady 11 -padx 3
3264    }
3265    pack .p
3266    update
3267    set result {}
3268    foreach w {.p.f1 .p.f2 .p.f3} {
3269        lappend result [list [winfo x $w] [winfo y $w] \
3270            [winfo width $w] [winfo height $w]]
3271        }
3272    return $result
3273} -cleanup {
3274    deleteWindows
3275} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}}
3276test panedwindow-19.71 {ComputeGeometry, one pane, reqsize set properly} -setup {
3277    deleteWindows
3278} -body {
3279    # With just one pane, sashpad and sashwidth should not
3280    # affect the panedwindow's geometry, since no sash should
3281    # ever be drawn.
3282    panedwindow .p -borderwidth 2 -sashpad 0 \
3283        -sashwidth 0 -handlesize 6 -showhandle 0
3284    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
3285    list [winfo reqwidth .p] [winfo reqheight .p]
3286} -cleanup {
3287    deleteWindows
3288} -result {24 24}
3289
3290test panedwindow-19.72 {ComputeGeometry, three panes, reqsize set properly} -setup {
3291    deleteWindows
3292} -body {
3293    panedwindow .p -borderwidth 2 -sashpad 0 \
3294        -sashwidth 0 -handlesize 6 -showhandle 0
3295    foreach w {.p.f1 .p.f2 .p.f3} {
3296        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3297    }
3298    list [winfo reqwidth .p] [winfo reqheight .p]
3299} -cleanup {
3300    deleteWindows
3301} -result {64 24}
3302
3303test panedwindow-19.73 {ComputeGeometry, sash coords} -setup {
3304    deleteWindows
3305} -body {
3306    panedwindow .p -borderwidth 2 -sashpad 0 \
3307        -sashwidth 0 -handlesize 6 -showhandle 0
3308    foreach w {.f1 .f2 .f3} {
3309        .p add [frame $w -width 20 -height 20 -bg blue] \
3310                            -sticky ""
3311    }
3312    list [.p sash coord 0] [.p sash coord 1]
3313} -cleanup {
3314    deleteWindows
3315} -result {{22 2} {42 2}}
3316
3317test panedwindow-19.74 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3318    deleteWindows
3319} -body {
3320    panedwindow .p -borderwidth 2 -sashpad 0 \
3321        -sashwidth 0 -handlesize 6 -showhandle 0
3322    foreach w {.p.f1 .p.f2 .p.f3} {
3323        .p add [frame $w -width 20 -height 20 -bg blue] \
3324            -sticky nsew -pady 3 -padx 11
3325    }
3326    pack .p
3327    update
3328    set result {}
3329    foreach w {.p.f1 .p.f2 .p.f3} {
3330        lappend result [list [winfo x $w] [winfo y $w] \
3331            [winfo width $w] [winfo height $w]]
3332    }
3333    return $result
3334} -cleanup {
3335    deleteWindows
3336} -result {{13 5 20 20} {55 5 20 20} {97 5 20 20}}
3337
3338test panedwindow-19.75 {ComputeGeometry, one pane, vertical} -setup {
3339    deleteWindows
3340} -body {
3341    # With just one pane, sashpad and sashwidth should not
3342    # affect the panedwindow's geometry, since no sash should
3343    # ever be drawn.
3344    panedwindow .p -borderwidth 2 -sashpad 0 \
3345        -orient vertical -sashwidth 0 -handlesize 6 \
3346        -showhandle 0
3347    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
3348                    -sticky ""
3349    list [winfo reqwidth .p] [winfo reqheight .p]
3350} -cleanup {
3351    deleteWindows
3352} -result {24 24}
3353
3354test panedwindow-19.76 {ComputeGeometry, three panes, vertical} -setup {
3355    deleteWindows
3356} -body {
3357    panedwindow .p -borderwidth 2 -sashpad 0 \
3358        -sashwidth 0 -handlesize 6 -showhandle 0 \
3359        -orient vertical
3360    foreach w {.f1 .f2 .f3} {
3361        .p add [frame $w -width 20 -height 20 -bg blue] \
3362                            -sticky ""
3363    }
3364    list [winfo reqwidth .p] [winfo reqheight .p]
3365} -cleanup {
3366    deleteWindows
3367} -result {24 64}
3368
3369test panedwindow-19.77 {ComputeGeometry, sash coords, vertical} -setup {
3370    deleteWindows
3371} -body {
3372    panedwindow .p -borderwidth 2 -sashpad 0 \
3373        -sashwidth 0 -handlesize 6 -showhandle 0 \
3374        -orient vertical
3375    foreach w {.f1 .f2 .f3} {
3376        .p add [frame $w -width 20 -height 20 -bg blue] \
3377                            -sticky ""
3378    }
3379    list [.p sash coord 0] [.p sash coord 1]
3380} -cleanup {
3381    deleteWindows
3382} -result {{2 22} {2 42}}
3383
3384test panedwindow-19.78 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
3385    deleteWindows
3386} -body {
3387    panedwindow .p -borderwidth 2 -sashpad 0 \
3388        -sashwidth 0 -handlesize 6 -showhandle 0 \
3389        -orient vertical
3390    foreach w {.p.f1 .p.f2 .p.f3} {
3391        .p add [frame $w -width 20 -height 20 -bg blue] \
3392            -sticky nsew -pady 11 -padx 3
3393    }
3394    pack .p
3395    update
3396    set result {}
3397    foreach w {.p.f1 .p.f2 .p.f3} {
3398        lappend result [list [winfo x $w] [winfo y $w] \
3399            [winfo width $w] [winfo height $w]]
3400        }
3401    return $result
3402} -cleanup {
3403    deleteWindows
3404} -result {{5 13 20 20} {5 55 20 20} {5 97 20 20}}
3405test panedwindow-19.79 {ComputeGeometry, one pane, reqsize set properly} -setup {
3406    deleteWindows
3407} -body {
3408    # With just one pane, sashpad and sashwidth should not
3409    # affect the panedwindow's geometry, since no sash should
3410    # ever be drawn.
3411    panedwindow .p -borderwidth 2 -sashpad 0 \
3412        -sashwidth 0 -handlesize 6 -showhandle 1
3413    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
3414    list [winfo reqwidth .p] [winfo reqheight .p]
3415} -cleanup {
3416    deleteWindows
3417} -result {26 24}
3418
3419test panedwindow-19.80 {ComputeGeometry, three panes, reqsize set properly} -setup {
3420    deleteWindows
3421} -body {
3422    panedwindow .p -borderwidth 2 -sashpad 0 \
3423        -sashwidth 0 -handlesize 6 -showhandle 1
3424    foreach w {.p.f1 .p.f2 .p.f3} {
3425        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3426    }
3427    list [winfo reqwidth .p] [winfo reqheight .p]
3428} -cleanup {
3429    deleteWindows
3430} -result {76 24}
3431
3432test panedwindow-19.81 {ComputeGeometry, sash coords} -setup {
3433    deleteWindows
3434} -body {
3435    panedwindow .p -borderwidth 2 -sashpad 0 \
3436        -sashwidth 0 -handlesize 6 -showhandle 1
3437    foreach w {.f1 .f2 .f3} {
3438        .p add [frame $w -width 20 -height 20 -bg blue] \
3439                            -sticky ""
3440    }
3441    list [.p sash coord 0] [.p sash coord 1]
3442} -cleanup {
3443    deleteWindows
3444} -result {{25 2} {51 2}}
3445
3446test panedwindow-19.82 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3447    deleteWindows
3448} -body {
3449    panedwindow .p -borderwidth 2 -sashpad 0 \
3450        -sashwidth 0 -handlesize 6 -showhandle 1
3451    foreach w {.p.f1 .p.f2 .p.f3} {
3452        .p add [frame $w -width 20 -height 20 -bg blue] \
3453            -sticky nsew -pady 3 -padx 11
3454    }
3455    pack .p
3456    update
3457    set result {}
3458    foreach w {.p.f1 .p.f2 .p.f3} {
3459        lappend result [list [winfo x $w] [winfo y $w] \
3460            [winfo width $w] [winfo height $w]]
3461    }
3462    return $result
3463} -cleanup {
3464    deleteWindows
3465} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}}
3466
3467test panedwindow-19.83 {ComputeGeometry, one pane, vertical} -setup {
3468    deleteWindows
3469} -body {
3470    # With just one pane, sashpad and sashwidth should not
3471    # affect the panedwindow's geometry, since no sash should
3472    # ever be drawn.
3473    panedwindow .p -borderwidth 2 -sashpad 0 \
3474        -orient vertical -sashwidth 0 -handlesize 6 \
3475        -showhandle 1
3476    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
3477                    -sticky ""
3478    list [winfo reqwidth .p] [winfo reqheight .p]
3479} -cleanup {
3480    deleteWindows
3481} -result {24 26}
3482
3483test panedwindow-19.84 {ComputeGeometry, three panes, vertical} -setup {
3484    deleteWindows
3485} -body {
3486    panedwindow .p -borderwidth 2 -sashpad 0 \
3487        -sashwidth 0 -handlesize 6 -showhandle 1 \
3488        -orient vertical
3489    foreach w {.f1 .f2 .f3} {
3490        .p add [frame $w -width 20 -height 20 -bg blue] \
3491                            -sticky ""
3492    }
3493    list [winfo reqwidth .p] [winfo reqheight .p]
3494} -cleanup {
3495    deleteWindows
3496} -result {24 76}
3497
3498test panedwindow-19.85 {ComputeGeometry, sash coords, vertical} -setup {
3499    deleteWindows
3500} -body {
3501    panedwindow .p -borderwidth 2 -sashpad 0 \
3502        -sashwidth 0 -handlesize 6 -showhandle 1 \
3503        -orient vertical
3504    foreach w {.f1 .f2 .f3} {
3505        .p add [frame $w -width 20 -height 20 -bg blue] \
3506                            -sticky ""
3507    }
3508    list [.p sash coord 0] [.p sash coord 1]
3509} -cleanup {
3510    deleteWindows
3511} -result {{2 25} {2 51}}
3512
3513test panedwindow-19.86 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
3514    deleteWindows
3515} -body {
3516    panedwindow .p -borderwidth 2 -sashpad 0 \
3517        -sashwidth 0 -handlesize 6 -showhandle 1 \
3518        -orient vertical
3519    foreach w {.p.f1 .p.f2 .p.f3} {
3520        .p add [frame $w -width 20 -height 20 -bg blue] \
3521            -sticky nsew -pady 11 -padx 3
3522    }
3523    pack .p
3524    update
3525    set result {}
3526    foreach w {.p.f1 .p.f2 .p.f3} {
3527        lappend result [list [winfo x $w] [winfo y $w] \
3528            [winfo width $w] [winfo height $w]]
3529        }
3530    return $result
3531} -cleanup {
3532    deleteWindows
3533} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}}
3534test panedwindow-19.87 {ComputeGeometry, one pane, reqsize set properly} -setup {
3535    deleteWindows
3536} -body {
3537    # With just one pane, sashpad and sashwidth should not
3538    # affect the panedwindow's geometry, since no sash should
3539    # ever be drawn.
3540    panedwindow .p -borderwidth 2 -sashpad 0 \
3541        -sashwidth 3 -handlesize 6 -showhandle 0
3542    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
3543    list [winfo reqwidth .p] [winfo reqheight .p]
3544} -cleanup {
3545    deleteWindows
3546} -result {24 24}
3547
3548test panedwindow-19.88 {ComputeGeometry, three panes, reqsize set properly} -setup {
3549    deleteWindows
3550} -body {
3551    panedwindow .p -borderwidth 2 -sashpad 0 \
3552        -sashwidth 3 -handlesize 6 -showhandle 0
3553    foreach w {.p.f1 .p.f2 .p.f3} {
3554        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3555    }
3556    list [winfo reqwidth .p] [winfo reqheight .p]
3557} -cleanup {
3558    deleteWindows
3559} -result {70 24}
3560
3561test panedwindow-19.89 {ComputeGeometry, sash coords} -setup {
3562    deleteWindows
3563} -body {
3564    panedwindow .p -borderwidth 2 -sashpad 0 \
3565        -sashwidth 3 -handlesize 6 -showhandle 0
3566    foreach w {.f1 .f2 .f3} {
3567        .p add [frame $w -width 20 -height 20 -bg blue] \
3568                            -sticky ""
3569    }
3570    list [.p sash coord 0] [.p sash coord 1]
3571} -cleanup {
3572    deleteWindows
3573} -result {{22 2} {45 2}}
3574
3575test panedwindow-19.90 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3576    deleteWindows
3577} -body {
3578    panedwindow .p -borderwidth 2 -sashpad 0 \
3579        -sashwidth 3 -handlesize 6 -showhandle 0
3580    foreach w {.p.f1 .p.f2 .p.f3} {
3581        .p add [frame $w -width 20 -height 20 -bg blue] \
3582            -sticky nsew -pady 3 -padx 11
3583    }
3584    pack .p
3585    update
3586    set result {}
3587    foreach w {.p.f1 .p.f2 .p.f3} {
3588        lappend result [list [winfo x $w] [winfo y $w] \
3589            [winfo width $w] [winfo height $w]]
3590    }
3591    return $result
3592} -cleanup {
3593    deleteWindows
3594} -result {{13 5 20 20} {58 5 20 20} {103 5 20 20}}
3595
3596test panedwindow-19.91 {ComputeGeometry, one pane, vertical} -setup {
3597    deleteWindows
3598} -body {
3599    # With just one pane, sashpad and sashwidth should not
3600    # affect the panedwindow's geometry, since no sash should
3601    # ever be drawn.
3602    panedwindow .p -borderwidth 2 -sashpad 0 \
3603        -orient vertical -sashwidth 3 -handlesize 6 \
3604        -showhandle 0
3605    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
3606                    -sticky ""
3607    list [winfo reqwidth .p] [winfo reqheight .p]
3608} -cleanup {
3609    deleteWindows
3610} -result {24 24}
3611
3612test panedwindow-19.92 {ComputeGeometry, three panes, vertical} -setup {
3613    deleteWindows
3614} -body {
3615    panedwindow .p -borderwidth 2 -sashpad 0 \
3616        -sashwidth 3 -handlesize 6 -showhandle 0 \
3617        -orient vertical
3618    foreach w {.f1 .f2 .f3} {
3619        .p add [frame $w -width 20 -height 20 -bg blue] \
3620                            -sticky ""
3621    }
3622    list [winfo reqwidth .p] [winfo reqheight .p]
3623} -cleanup {
3624    deleteWindows
3625} -result {24 70}
3626
3627test panedwindow-19.93 {ComputeGeometry, sash coords, vertical} -setup {
3628    deleteWindows
3629} -body {
3630    panedwindow .p -borderwidth 2 -sashpad 0 \
3631        -sashwidth 3 -handlesize 6 -showhandle 0 \
3632        -orient vertical
3633    foreach w {.f1 .f2 .f3} {
3634        .p add [frame $w -width 20 -height 20 -bg blue] \
3635                            -sticky ""
3636    }
3637    list [.p sash coord 0] [.p sash coord 1]
3638} -cleanup {
3639    deleteWindows
3640} -result {{2 22} {2 45}}
3641
3642test panedwindow-19.94 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
3643    deleteWindows
3644} -body {
3645    panedwindow .p -borderwidth 2 -sashpad 0 \
3646        -sashwidth 3 -handlesize 6 -showhandle 0 \
3647        -orient vertical
3648    foreach w {.p.f1 .p.f2 .p.f3} {
3649        .p add [frame $w -width 20 -height 20 -bg blue] \
3650            -sticky nsew -pady 11 -padx 3
3651    }
3652    pack .p
3653    update
3654    set result {}
3655    foreach w {.p.f1 .p.f2 .p.f3} {
3656        lappend result [list [winfo x $w] [winfo y $w] \
3657            [winfo width $w] [winfo height $w]]
3658        }
3659    return $result
3660} -cleanup {
3661    deleteWindows
3662} -result {{5 13 20 20} {5 58 20 20} {5 103 20 20}}
3663test panedwindow-19.95 {ComputeGeometry, one pane, reqsize set properly} -setup {
3664    deleteWindows
3665} -body {
3666    # With just one pane, sashpad and sashwidth should not
3667    # affect the panedwindow's geometry, since no sash should
3668    # ever be drawn.
3669    panedwindow .p -borderwidth 2 -sashpad 0 \
3670        -sashwidth 3 -handlesize 6 -showhandle 1
3671    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
3672    list [winfo reqwidth .p] [winfo reqheight .p]
3673} -cleanup {
3674    deleteWindows
3675} -result {26 24}
3676
3677test panedwindow-19.96 {ComputeGeometry, three panes, reqsize set properly} -setup {
3678    deleteWindows
3679} -body {
3680    panedwindow .p -borderwidth 2 -sashpad 0 \
3681        -sashwidth 3 -handlesize 6 -showhandle 1
3682    foreach w {.p.f1 .p.f2 .p.f3} {
3683        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3684    }
3685    list [winfo reqwidth .p] [winfo reqheight .p]
3686} -cleanup {
3687    deleteWindows
3688} -result {76 24}
3689
3690test panedwindow-19.97 {ComputeGeometry, sash coords} -setup {
3691    deleteWindows
3692} -body {
3693    panedwindow .p -borderwidth 2 -sashpad 0 \
3694        -sashwidth 3 -handlesize 6 -showhandle 1
3695    foreach w {.f1 .f2 .f3} {
3696        .p add [frame $w -width 20 -height 20 -bg blue] \
3697                            -sticky ""
3698    }
3699    list [.p sash coord 0] [.p sash coord 1]
3700} -cleanup {
3701    deleteWindows
3702} -result {{23 2} {49 2}}
3703
3704test panedwindow-19.98 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3705    deleteWindows
3706} -body {
3707    panedwindow .p -borderwidth 2 -sashpad 0 \
3708        -sashwidth 3 -handlesize 6 -showhandle 1
3709    foreach w {.p.f1 .p.f2 .p.f3} {
3710        .p add [frame $w -width 20 -height 20 -bg blue] \
3711            -sticky nsew -pady 3 -padx 11
3712    }
3713    pack .p
3714    update
3715    set result {}
3716    foreach w {.p.f1 .p.f2 .p.f3} {
3717        lappend result [list [winfo x $w] [winfo y $w] \
3718            [winfo width $w] [winfo height $w]]
3719    }
3720    return $result
3721} -cleanup {
3722    deleteWindows
3723} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}}
3724
3725test panedwindow-19.99 {ComputeGeometry, one pane, vertical} -setup {
3726    deleteWindows
3727} -body {
3728    # With just one pane, sashpad and sashwidth should not
3729    # affect the panedwindow's geometry, since no sash should
3730    # ever be drawn.
3731    panedwindow .p -borderwidth 2 -sashpad 0 \
3732        -orient vertical -sashwidth 3 -handlesize 6 \
3733        -showhandle 1
3734    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
3735                    -sticky ""
3736    list [winfo reqwidth .p] [winfo reqheight .p]
3737} -cleanup {
3738    deleteWindows
3739} -result {24 26}
3740
3741test panedwindow-19.100 {ComputeGeometry, three panes, vertical} -setup {
3742    deleteWindows
3743} -body {
3744    panedwindow .p -borderwidth 2 -sashpad 0 \
3745        -sashwidth 3 -handlesize 6 -showhandle 1 \
3746        -orient vertical
3747    foreach w {.f1 .f2 .f3} {
3748        .p add [frame $w -width 20 -height 20 -bg blue] \
3749                            -sticky ""
3750    }
3751    list [winfo reqwidth .p] [winfo reqheight .p]
3752} -cleanup {
3753    deleteWindows
3754} -result {24 76}
3755
3756test panedwindow-19.101 {ComputeGeometry, sash coords, vertical} -setup {
3757    deleteWindows
3758} -body {
3759    panedwindow .p -borderwidth 2 -sashpad 0 \
3760        -sashwidth 3 -handlesize 6 -showhandle 1 \
3761        -orient vertical
3762    foreach w {.f1 .f2 .f3} {
3763        .p add [frame $w -width 20 -height 20 -bg blue] \
3764                            -sticky ""
3765    }
3766    list [.p sash coord 0] [.p sash coord 1]
3767} -cleanup {
3768    deleteWindows
3769} -result {{2 23} {2 49}}
3770
3771test panedwindow-19.102 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
3772    deleteWindows
3773} -body {
3774    panedwindow .p -borderwidth 2 -sashpad 0 \
3775        -sashwidth 3 -handlesize 6 -showhandle 1 \
3776        -orient vertical
3777    foreach w {.p.f1 .p.f2 .p.f3} {
3778        .p add [frame $w -width 20 -height 20 -bg blue] \
3779            -sticky nsew -pady 11 -padx 3
3780    }
3781    pack .p
3782    update
3783    set result {}
3784    foreach w {.p.f1 .p.f2 .p.f3} {
3785        lappend result [list [winfo x $w] [winfo y $w] \
3786            [winfo width $w] [winfo height $w]]
3787        }
3788    return $result
3789} -cleanup {
3790    deleteWindows
3791} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}}
3792test panedwindow-19.103 {ComputeGeometry, one pane, reqsize set properly} -setup {
3793    deleteWindows
3794} -body {
3795    # With just one pane, sashpad and sashwidth should not
3796    # affect the panedwindow's geometry, since no sash should
3797    # ever be drawn.
3798    panedwindow .p -borderwidth 2 -sashpad 5 \
3799        -sashwidth 0 -handlesize 6 -showhandle 0
3800    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
3801    list [winfo reqwidth .p] [winfo reqheight .p]
3802} -cleanup {
3803    deleteWindows
3804} -result {24 24}
3805
3806test panedwindow-19.104 {ComputeGeometry, three panes, reqsize set properly} -setup {
3807    deleteWindows
3808} -body {
3809    panedwindow .p -borderwidth 2 -sashpad 5 \
3810        -sashwidth 0 -handlesize 6 -showhandle 0
3811    foreach w {.p.f1 .p.f2 .p.f3} {
3812        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3813    }
3814    list [winfo reqwidth .p] [winfo reqheight .p]
3815} -cleanup {
3816    deleteWindows
3817} -result {84 24}
3818
3819test panedwindow-19.105 {ComputeGeometry, sash coords} -setup {
3820    deleteWindows
3821} -body {
3822    panedwindow .p -borderwidth 2 -sashpad 5 \
3823        -sashwidth 0 -handlesize 6 -showhandle 0
3824    foreach w {.f1 .f2 .f3} {
3825        .p add [frame $w -width 20 -height 20 -bg blue] \
3826                            -sticky ""
3827    }
3828    list [.p sash coord 0] [.p sash coord 1]
3829} -cleanup {
3830    deleteWindows
3831} -result {{27 2} {57 2}}
3832
3833test panedwindow-19.106 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3834    deleteWindows
3835} -body {
3836    panedwindow .p -borderwidth 2 -sashpad 5 \
3837        -sashwidth 0 -handlesize 6 -showhandle 0
3838    foreach w {.p.f1 .p.f2 .p.f3} {
3839        .p add [frame $w -width 20 -height 20 -bg blue] \
3840            -sticky nsew -pady 3 -padx 11
3841    }
3842    pack .p
3843    update
3844    set result {}
3845    foreach w {.p.f1 .p.f2 .p.f3} {
3846        lappend result [list [winfo x $w] [winfo y $w] \
3847            [winfo width $w] [winfo height $w]]
3848    }
3849    return $result
3850} -cleanup {
3851    deleteWindows
3852} -result {{13 5 20 20} {65 5 20 20} {117 5 20 20}}
3853
3854test panedwindow-19.107 {ComputeGeometry, one pane, vertical} -setup {
3855    deleteWindows
3856} -body {
3857    # With just one pane, sashpad and sashwidth should not
3858    # affect the panedwindow's geometry, since no sash should
3859    # ever be drawn.
3860    panedwindow .p -borderwidth 2 -sashpad 5 \
3861        -orient vertical -sashwidth 0 -handlesize 6 \
3862        -showhandle 0
3863    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
3864                    -sticky ""
3865    list [winfo reqwidth .p] [winfo reqheight .p]
3866} -cleanup {
3867    deleteWindows
3868} -result {24 24}
3869
3870test panedwindow-19.108 {ComputeGeometry, three panes, vertical} -setup {
3871    deleteWindows
3872} -body {
3873    panedwindow .p -borderwidth 2 -sashpad 5 \
3874        -sashwidth 0 -handlesize 6 -showhandle 0 \
3875        -orient vertical
3876    foreach w {.f1 .f2 .f3} {
3877        .p add [frame $w -width 20 -height 20 -bg blue] \
3878                            -sticky ""
3879    }
3880    list [winfo reqwidth .p] [winfo reqheight .p]
3881} -cleanup {
3882    deleteWindows
3883} -result {24 84}
3884
3885test panedwindow-19.109 {ComputeGeometry, sash coords, vertical} -setup {
3886    deleteWindows
3887} -body {
3888    panedwindow .p -borderwidth 2 -sashpad 5 \
3889        -sashwidth 0 -handlesize 6 -showhandle 0 \
3890        -orient vertical
3891    foreach w {.f1 .f2 .f3} {
3892        .p add [frame $w -width 20 -height 20 -bg blue] \
3893                            -sticky ""
3894    }
3895    list [.p sash coord 0] [.p sash coord 1]
3896} -cleanup {
3897    deleteWindows
3898} -result {{2 27} {2 57}}
3899
3900test panedwindow-19.110 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
3901    deleteWindows
3902} -body {
3903    panedwindow .p -borderwidth 2 -sashpad 5 \
3904        -sashwidth 0 -handlesize 6 -showhandle 0 \
3905        -orient vertical
3906    foreach w {.p.f1 .p.f2 .p.f3} {
3907        .p add [frame $w -width 20 -height 20 -bg blue] \
3908            -sticky nsew -pady 11 -padx 3
3909    }
3910    pack .p
3911    update
3912    set result {}
3913    foreach w {.p.f1 .p.f2 .p.f3} {
3914        lappend result [list [winfo x $w] [winfo y $w] \
3915            [winfo width $w] [winfo height $w]]
3916        }
3917    return $result
3918} -cleanup {
3919    deleteWindows
3920} -result {{5 13 20 20} {5 65 20 20} {5 117 20 20}}
3921test panedwindow-19.111 {ComputeGeometry, one pane, reqsize set properly} -setup {
3922    deleteWindows
3923} -body {
3924    # With just one pane, sashpad and sashwidth should not
3925    # affect the panedwindow's geometry, since no sash should
3926    # ever be drawn.
3927    panedwindow .p -borderwidth 2 -sashpad 5 \
3928        -sashwidth 0 -handlesize 6 -showhandle 1
3929    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
3930    list [winfo reqwidth .p] [winfo reqheight .p]
3931} -cleanup {
3932    deleteWindows
3933} -result {26 24}
3934
3935test panedwindow-19.112 {ComputeGeometry, three panes, reqsize set properly} -setup {
3936    deleteWindows
3937} -body {
3938    panedwindow .p -borderwidth 2 -sashpad 5 \
3939        -sashwidth 0 -handlesize 6 -showhandle 1
3940    foreach w {.p.f1 .p.f2 .p.f3} {
3941        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
3942    }
3943    list [winfo reqwidth .p] [winfo reqheight .p]
3944} -cleanup {
3945    deleteWindows
3946} -result {96 24}
3947
3948test panedwindow-19.113 {ComputeGeometry, sash coords} -setup {
3949    deleteWindows
3950} -body {
3951    panedwindow .p -borderwidth 2 -sashpad 5 \
3952        -sashwidth 0 -handlesize 6 -showhandle 1
3953    foreach w {.f1 .f2 .f3} {
3954        .p add [frame $w -width 20 -height 20 -bg blue] \
3955                            -sticky ""
3956    }
3957    list [.p sash coord 0] [.p sash coord 1]
3958} -cleanup {
3959    deleteWindows
3960} -result {{30 2} {66 2}}
3961
3962test panedwindow-19.114 {ComputeGeometry/ArrangePanes, pane coords} -setup {
3963    deleteWindows
3964} -body {
3965    panedwindow .p -borderwidth 2 -sashpad 5 \
3966        -sashwidth 0 -handlesize 6 -showhandle 1
3967    foreach w {.p.f1 .p.f2 .p.f3} {
3968        .p add [frame $w -width 20 -height 20 -bg blue] \
3969            -sticky nsew -pady 3 -padx 11
3970    }
3971    pack .p
3972    update
3973    set result {}
3974    foreach w {.p.f1 .p.f2 .p.f3} {
3975        lappend result [list [winfo x $w] [winfo y $w] \
3976            [winfo width $w] [winfo height $w]]
3977    }
3978    return $result
3979} -cleanup {
3980    deleteWindows
3981} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}}
3982
3983test panedwindow-19.115 {ComputeGeometry, one pane, vertical} -setup {
3984    deleteWindows
3985} -body {
3986    # With just one pane, sashpad and sashwidth should not
3987    # affect the panedwindow's geometry, since no sash should
3988    # ever be drawn.
3989    panedwindow .p -borderwidth 2 -sashpad 5 \
3990        -orient vertical -sashwidth 0 -handlesize 6 \
3991        -showhandle 1
3992    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
3993                    -sticky ""
3994    list [winfo reqwidth .p] [winfo reqheight .p]
3995} -cleanup {
3996    deleteWindows
3997} -result {24 26}
3998
3999test panedwindow-19.116 {ComputeGeometry, three panes, vertical} -setup {
4000    deleteWindows
4001} -body {
4002    panedwindow .p -borderwidth 2 -sashpad 5 \
4003        -sashwidth 0 -handlesize 6 -showhandle 1 \
4004        -orient vertical
4005    foreach w {.f1 .f2 .f3} {
4006        .p add [frame $w -width 20 -height 20 -bg blue] \
4007                            -sticky ""
4008    }
4009    list [winfo reqwidth .p] [winfo reqheight .p]
4010} -cleanup {
4011    deleteWindows
4012} -result {24 96}
4013
4014test panedwindow-19.117 {ComputeGeometry, sash coords, vertical} -setup {
4015    deleteWindows
4016} -body {
4017    panedwindow .p -borderwidth 2 -sashpad 5 \
4018        -sashwidth 0 -handlesize 6 -showhandle 1 \
4019        -orient vertical
4020    foreach w {.f1 .f2 .f3} {
4021        .p add [frame $w -width 20 -height 20 -bg blue] \
4022                            -sticky ""
4023    }
4024    list [.p sash coord 0] [.p sash coord 1]
4025} -cleanup {
4026    deleteWindows
4027} -result {{2 30} {2 66}}
4028
4029test panedwindow-19.118 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
4030    deleteWindows
4031} -body {
4032    panedwindow .p -borderwidth 2 -sashpad 5 \
4033        -sashwidth 0 -handlesize 6 -showhandle 1 \
4034        -orient vertical
4035    foreach w {.p.f1 .p.f2 .p.f3} {
4036        .p add [frame $w -width 20 -height 20 -bg blue] \
4037            -sticky nsew -pady 11 -padx 3
4038    }
4039    pack .p
4040    update
4041    set result {}
4042    foreach w {.p.f1 .p.f2 .p.f3} {
4043        lappend result [list [winfo x $w] [winfo y $w] \
4044            [winfo width $w] [winfo height $w]]
4045        }
4046    return $result
4047} -cleanup {
4048    deleteWindows
4049} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}}
4050test panedwindow-19.119 {ComputeGeometry, one pane, reqsize set properly} -setup {
4051    deleteWindows
4052} -body {
4053    # With just one pane, sashpad and sashwidth should not
4054    # affect the panedwindow's geometry, since no sash should
4055    # ever be drawn.
4056    panedwindow .p -borderwidth 2 -sashpad 5 \
4057        -sashwidth 3 -handlesize 6 -showhandle 0
4058    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
4059    list [winfo reqwidth .p] [winfo reqheight .p]
4060} -cleanup {
4061    deleteWindows
4062} -result {24 24}
4063
4064test panedwindow-19.120 {ComputeGeometry, three panes, reqsize set properly} -setup {
4065    deleteWindows
4066} -body {
4067    panedwindow .p -borderwidth 2 -sashpad 5 \
4068        -sashwidth 3 -handlesize 6 -showhandle 0
4069    foreach w {.p.f1 .p.f2 .p.f3} {
4070        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
4071    }
4072    list [winfo reqwidth .p] [winfo reqheight .p]
4073} -cleanup {
4074    deleteWindows
4075} -result {90 24}
4076
4077test panedwindow-19.121 {ComputeGeometry, sash coords} -setup {
4078    deleteWindows
4079} -body {
4080    panedwindow .p -borderwidth 2 -sashpad 5 \
4081        -sashwidth 3 -handlesize 6 -showhandle 0
4082    foreach w {.f1 .f2 .f3} {
4083        .p add [frame $w -width 20 -height 20 -bg blue] \
4084                            -sticky ""
4085    }
4086    list [.p sash coord 0] [.p sash coord 1]
4087} -cleanup {
4088    deleteWindows
4089} -result {{27 2} {60 2}}
4090
4091test panedwindow-19.122 {ComputeGeometry/ArrangePanes, pane coords} -setup {
4092    deleteWindows
4093} -body {
4094    panedwindow .p -borderwidth 2 -sashpad 5 \
4095        -sashwidth 3 -handlesize 6 -showhandle 0
4096    foreach w {.p.f1 .p.f2 .p.f3} {
4097        .p add [frame $w -width 20 -height 20 -bg blue] \
4098            -sticky nsew -pady 3 -padx 11
4099    }
4100    pack .p
4101    update
4102    set result {}
4103    foreach w {.p.f1 .p.f2 .p.f3} {
4104        lappend result [list [winfo x $w] [winfo y $w] \
4105            [winfo width $w] [winfo height $w]]
4106    }
4107    return $result
4108} -cleanup {
4109    deleteWindows
4110} -result {{13 5 20 20} {68 5 20 20} {123 5 20 20}}
4111
4112test panedwindow-19.123 {ComputeGeometry, one pane, vertical} -setup {
4113    deleteWindows
4114} -body {
4115    # With just one pane, sashpad and sashwidth should not
4116    # affect the panedwindow's geometry, since no sash should
4117    # ever be drawn.
4118    panedwindow .p -borderwidth 2 -sashpad 5 \
4119        -orient vertical -sashwidth 3 -handlesize 6 \
4120        -showhandle 0
4121    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
4122                    -sticky ""
4123    list [winfo reqwidth .p] [winfo reqheight .p]
4124} -cleanup {
4125    deleteWindows
4126} -result {24 24}
4127
4128test panedwindow-19.124 {ComputeGeometry, three panes, vertical} -setup {
4129    deleteWindows
4130} -body {
4131    panedwindow .p -borderwidth 2 -sashpad 5 \
4132        -sashwidth 3 -handlesize 6 -showhandle 0 \
4133        -orient vertical
4134    foreach w {.f1 .f2 .f3} {
4135        .p add [frame $w -width 20 -height 20 -bg blue] \
4136                            -sticky ""
4137    }
4138    list [winfo reqwidth .p] [winfo reqheight .p]
4139} -cleanup {
4140    deleteWindows
4141} -result {24 90}
4142
4143test panedwindow-19.125 {ComputeGeometry, sash coords, vertical} -setup {
4144    deleteWindows
4145} -body {
4146    panedwindow .p -borderwidth 2 -sashpad 5 \
4147        -sashwidth 3 -handlesize 6 -showhandle 0 \
4148        -orient vertical
4149    foreach w {.f1 .f2 .f3} {
4150        .p add [frame $w -width 20 -height 20 -bg blue] \
4151                            -sticky ""
4152    }
4153    list [.p sash coord 0] [.p sash coord 1]
4154} -cleanup {
4155    deleteWindows
4156} -result {{2 27} {2 60}}
4157
4158test panedwindow-19.126 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
4159    deleteWindows
4160} -body {
4161    panedwindow .p -borderwidth 2 -sashpad 5 \
4162        -sashwidth 3 -handlesize 6 -showhandle 0 \
4163        -orient vertical
4164    foreach w {.p.f1 .p.f2 .p.f3} {
4165        .p add [frame $w -width 20 -height 20 -bg blue] \
4166            -sticky nsew -pady 11 -padx 3
4167    }
4168    pack .p
4169    update
4170    set result {}
4171    foreach w {.p.f1 .p.f2 .p.f3} {
4172        lappend result [list [winfo x $w] [winfo y $w] \
4173            [winfo width $w] [winfo height $w]]
4174        }
4175    return $result
4176} -cleanup {
4177    deleteWindows
4178} -result {{5 13 20 20} {5 68 20 20} {5 123 20 20}}
4179test panedwindow-19.127 {ComputeGeometry, one pane, reqsize set properly} -setup {
4180    deleteWindows
4181} -body {
4182    # With just one pane, sashpad and sashwidth should not
4183    # affect the panedwindow's geometry, since no sash should
4184    # ever be drawn.
4185    panedwindow .p -borderwidth 2 -sashpad 5 \
4186        -sashwidth 3 -handlesize 6 -showhandle 1
4187    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
4188    list [winfo reqwidth .p] [winfo reqheight .p]
4189} -cleanup {
4190    deleteWindows
4191} -result {26 24}
4192
4193test panedwindow-19.128 {ComputeGeometry, three panes, reqsize set properly} -setup {
4194    deleteWindows
4195} -body {
4196    panedwindow .p -borderwidth 2 -sashpad 5 \
4197        -sashwidth 3 -handlesize 6 -showhandle 1
4198    foreach w {.p.f1 .p.f2 .p.f3} {
4199        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
4200    }
4201    list [winfo reqwidth .p] [winfo reqheight .p]
4202} -cleanup {
4203    deleteWindows
4204} -result {96 24}
4205
4206test panedwindow-19.129 {ComputeGeometry, sash coords} -setup {
4207    deleteWindows
4208} -body {
4209    panedwindow .p -borderwidth 2 -sashpad 5 \
4210        -sashwidth 3 -handlesize 6 -showhandle 1
4211    foreach w {.f1 .f2 .f3} {
4212        .p add [frame $w -width 20 -height 20 -bg blue] \
4213                            -sticky ""
4214    }
4215    list [.p sash coord 0] [.p sash coord 1]
4216} -cleanup {
4217    deleteWindows
4218} -result {{28 2} {64 2}}
4219
4220test panedwindow-19.130 {ComputeGeometry/ArrangePanes, pane coords} -setup {
4221    deleteWindows
4222} -body {
4223    panedwindow .p -borderwidth 2 -sashpad 5 \
4224        -sashwidth 3 -handlesize 6 -showhandle 1
4225    foreach w {.p.f1 .p.f2 .p.f3} {
4226        .p add [frame $w -width 20 -height 20 -bg blue] \
4227            -sticky nsew -pady 3 -padx 11
4228    }
4229    pack .p
4230    update
4231    set result {}
4232    foreach w {.p.f1 .p.f2 .p.f3} {
4233        lappend result [list [winfo x $w] [winfo y $w] \
4234            [winfo width $w] [winfo height $w]]
4235    }
4236    return $result
4237} -cleanup {
4238    deleteWindows
4239} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}}
4240
4241test panedwindow-19.131 {ComputeGeometry, one pane, vertical} -setup {
4242    deleteWindows
4243} -body {
4244    # With just one pane, sashpad and sashwidth should not
4245    # affect the panedwindow's geometry, since no sash should
4246    # ever be drawn.
4247    panedwindow .p -borderwidth 2 -sashpad 5 \
4248        -orient vertical -sashwidth 3 -handlesize 6 \
4249        -showhandle 1
4250    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
4251                    -sticky ""
4252    list [winfo reqwidth .p] [winfo reqheight .p]
4253} -cleanup {
4254    deleteWindows
4255} -result {24 26}
4256
4257test panedwindow-19.132 {ComputeGeometry, three panes, vertical} -setup {
4258    deleteWindows
4259} -body {
4260    panedwindow .p -borderwidth 2 -sashpad 5 \
4261        -sashwidth 3 -handlesize 6 -showhandle 1 \
4262        -orient vertical
4263    foreach w {.f1 .f2 .f3} {
4264        .p add [frame $w -width 20 -height 20 -bg blue] \
4265                            -sticky ""
4266    }
4267    list [winfo reqwidth .p] [winfo reqheight .p]
4268} -cleanup {
4269    deleteWindows
4270} -result {24 96}
4271
4272test panedwindow-19.133 {ComputeGeometry, sash coords, vertical} -setup {
4273    deleteWindows
4274} -body {
4275    panedwindow .p -borderwidth 2 -sashpad 5 \
4276        -sashwidth 3 -handlesize 6 -showhandle 1 \
4277        -orient vertical
4278    foreach w {.f1 .f2 .f3} {
4279        .p add [frame $w -width 20 -height 20 -bg blue] \
4280                            -sticky ""
4281    }
4282    list [.p sash coord 0] [.p sash coord 1]
4283} -cleanup {
4284    deleteWindows
4285} -result {{2 28} {2 64}}
4286
4287test panedwindow-19.134 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
4288    deleteWindows
4289} -body {
4290    panedwindow .p -borderwidth 2 -sashpad 5 \
4291        -sashwidth 3 -handlesize 6 -showhandle 1 \
4292        -orient vertical
4293    foreach w {.p.f1 .p.f2 .p.f3} {
4294        .p add [frame $w -width 20 -height 20 -bg blue] \
4295            -sticky nsew -pady 11 -padx 3
4296    }
4297    pack .p
4298    update
4299    set result {}
4300    foreach w {.p.f1 .p.f2 .p.f3} {
4301        lappend result [list [winfo x $w] [winfo y $w] \
4302            [winfo width $w] [winfo height $w]]
4303        }
4304    return $result
4305} -cleanup {
4306    deleteWindows
4307} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}}
4308
4309
4310test panedwindow-20.1 {destroyed widgets are removed from panedwindow} -setup {
4311	deleteWindows
4312} -body {
4313    panedwindow .p
4314    .p add [frame .f -width 20 -height 20 -bg blue]
4315    destroy .f
4316    .p panes
4317} -cleanup {
4318	deleteWindows
4319} -result {}
4320test panedwindow-20.2 {destroyed pane causes geometry recomputation} -setup {
4321	deleteWindows
4322} -body {
4323    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
4324    .p add [frame .f -width 20 -height 20 -bg blue] \
4325	    [frame .f2 -width 20 -height 20 -bg red]
4326    destroy .f
4327    winfo reqwidth .p
4328} -cleanup {
4329    deleteWindows
4330} -result 20
4331
4332
4333test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -setup {
4334	deleteWindows
4335} -body {
4336    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
4337    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4338	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
4339    place .p -width 100 -x 0 -y 0
4340    update
4341    winfo width .f2
4342} -cleanup {
4343    deleteWindows
4344} -result 78
4345test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -setup {
4346	deleteWindows
4347} -body {
4348    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
4349            -orient vertical
4350    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4351	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
4352    place .p -height 100 -x 0 -y 0
4353    update
4354    winfo height .f2
4355} -cleanup {
4356    deleteWindows
4357} -result 78
4358test panedwindow-21.3 {ArrangePanes, explicit height/width are preferred} -setup {
4359	deleteWindows
4360} -body {
4361    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
4362    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4363	    [frame .f2 -width 20 -height 20 -bg red] -sticky ""
4364    .p paneconfigure .f1 -width 10 -height 15
4365    pack .p
4366    update
4367    list [winfo width .f1] [winfo height .f1]
4368} -cleanup {
4369	deleteWindows
4370} -result {10 15}
4371test panedwindow-21.4 {ArrangePanes, panes clipped by size of pane} -setup {
4372	deleteWindows
4373} -body {
4374    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
4375    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4376	    [frame .f2 -width 20 -height 20 -bg red]
4377    .p sash place 0 10 0
4378    pack .p
4379    update
4380    list [winfo width .f1] [winfo height .f1]
4381} -cleanup {
4382	deleteWindows
4383} -result {10 20}
4384test panedwindow-21.5 {ArrangePanes, panes clipped by size of pane} -setup {
4385	deleteWindows
4386} -body {
4387    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
4388            -orient vertical
4389    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4390	    [frame .f2 -width 20 -height 20 -bg red]
4391    .p sash place 0 0 10
4392    pack .p
4393    update
4394    list [winfo width .f1] [winfo height .f1]
4395} -cleanup {
4396	deleteWindows
4397} -result {20 10}
4398test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -setup {
4399	deleteWindows
4400} -body {
4401    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
4402    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
4403	    [frame .p.f2 -width 20 -height 40 -bg red] -sticky ""
4404    pack .p
4405    update
4406    winfo y .p.f1
4407} -cleanup {
4408    deleteWindows
4409} -result 10
4410test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setup {
4411	deleteWindows
4412} -body {
4413    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
4414            -orient vertical
4415    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
4416	    [frame .p.f2 -width 40 -height 40 -bg red] -sticky ""
4417    pack .p
4418    update
4419    winfo x .p.f1
4420} -cleanup {
4421    deleteWindows
4422} -result 10
4423test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
4424	deleteWindows
4425} -body {
4426    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
4427    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4428	    [frame .f2 -width 20 -height 40 -bg red]
4429    pack .p
4430    update
4431    set result [winfo ismapped .f1]
4432    .p sash place 0 0 0
4433    update
4434    lappend result [winfo ismapped .f1]
4435} -cleanup {
4436	deleteWindows
4437} -result {1 0}
4438test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
4439	deleteWindows
4440} -body {
4441    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
4442    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
4443	    [frame .p.f2 -width 20 -height 40 -bg red]
4444    pack .p
4445    update
4446    set result [winfo ismapped .p.f1]
4447    .p sash place 0 0 0
4448    update
4449    lappend result [winfo ismapped .p.f1]
4450} -cleanup {
4451	deleteWindows
4452} -result {1 0}
4453test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
4454	deleteWindows
4455} -body {
4456    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 -orient vertical
4457    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
4458	    [frame .p.f2 -width 20 -height 40 -bg red]
4459    pack .p
4460    update
4461    set result [winfo ismapped .p.f1]
4462    .p sash place 0 0 0
4463    update
4464    lappend result [winfo ismapped .p.f1]
4465} -cleanup {
4466	deleteWindows
4467} -result {1 0}
4468test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup {
4469	deleteWindows
4470} -body {
4471    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
4472    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4473	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
4474    place .p -width 40 -x 0 -y 0
4475    update
4476    winfo width .f2
4477} -cleanup {
4478    deleteWindows
4479} -result 18
4480test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup {
4481	deleteWindows
4482} -body {
4483    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
4484            -orient vertical
4485    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4486	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
4487    place .p -height 40 -x 0 -y 0
4488    update
4489    winfo height .f2
4490} -cleanup {
4491    deleteWindows
4492} -result 18
4493test panedwindow-21.13 {ArrangePanes, panedwindow resizes} -setup {
4494	deleteWindows
4495} -body {
4496	panedwindow .p -width 200 -borderwidth 0
4497	frame .f1 -height 50 -bg blue
4498	set result [list]
4499	lappend result [winfo reqwidth .p] [winfo reqheight .p]
4500	.p add .f1
4501	pack .p
4502	lappend result [winfo reqwidth .p] [winfo reqheight .p]
4503} -cleanup {
4504    deleteWindows
4505} -result {200 1 200 50}
4506test panedwindow-21.14 {ArrangePanes, panedwindow resizes} -setup {
4507	deleteWindows
4508} -body {
4509	panedwindow .p -height 200 -borderwidth 0 -orient vertical
4510	frame .f1 -width 50 -bg blue
4511	set result [list]
4512	lappend result [winfo reqwidth .p] [winfo reqheight .p]
4513	.p add .f1
4514	pack .p
4515	lappend result [winfo reqwidth .p] [winfo reqheight .p]
4516} -cleanup {
4517    deleteWindows
4518} -result {1 200 50 200}
4519test panedwindow-21.15 {ArrangePanes, last pane grows} -setup {
4520	deleteWindows
4521} -body {
4522	panedwindow .p -showhandle false -height 50
4523	.p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
4524		[frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
4525	.p sash place 1 250 0
4526	pack .p
4527	update
4528	set result [list]
4529	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4530		[winfo width .f4] [winfo width .p]
4531	.p configure -width 300
4532	update
4533	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4534		[winfo width .f4] [winfo width .p]
4535} -cleanup {
4536    deleteWindows
4537} -result {50 150 1 1 211 50 150 1 89 300}
4538
4539
4540test panedwindow-22.1 {PanedWindowReqProc, react to pane geometry changes} -setup {
4541	deleteWindows
4542} -body {
4543    # Basically just want to make sure that the PanedWindowReqProc is called
4544    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
4545    .p add [frame .f1 -width 20 -height 20 -bg blue] \
4546	    [frame .f2 -width 20 -height 40 -bg red]
4547    set result [winfo reqheight .p]
4548    .f1 configure -height 80
4549    lappend result [winfo reqheight .p]
4550} -cleanup {
4551	deleteWindows
4552} -result {40 80}
4553test panedwindow-22.2 {PanedWindowReqProc, react to pane geometry changes} -setup {
4554	deleteWindows
4555} -body {
4556    panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2
4557    .p add [frame .f1 -width 10] [frame .f2 -width 10]
4558    set result [winfo reqwidth .p]
4559    .f1 configure -width 20
4560    lappend result [winfo reqwidth .p]
4561    destroy .p .f1 .f2
4562    expr {[lindex $result 1] - [lindex $result 0]}
4563} -cleanup {
4564	deleteWindows
4565} -result {10}
4566
4567
4568test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup {
4569	deleteWindows
4570} -body {
4571    panedwindow .p
4572    .p add .p
4573} -cleanup {
4574	deleteWindows
4575} -returnCodes error -result {can't add .p to itself}
4576test panedwindow-23.2 {ConfigurePanes, bad window throws error} -setup {
4577	deleteWindows
4578} -body {
4579    panedwindow .p
4580    .p add .b
4581} -cleanup {
4582	deleteWindows
4583} -returnCodes error -result {bad window path name ".b"}
4584test panedwindow-23.3 {ConfigurePanes, bad window aborts processing} -setup {
4585	deleteWindows
4586} -body {
4587    panedwindow .p
4588    button .b
4589    catch {.p add .b .a}
4590    .p panes
4591} -cleanup {
4592	deleteWindows
4593} -result {}
4594test panedwindow-23.4 {ConfigurePanes, bad option aborts processing} -setup {
4595	deleteWindows
4596} -body {
4597    panedwindow .p
4598    button .b
4599    catch {.p add .b -sticky foobar}
4600    .p panes
4601} -cleanup {
4602	deleteWindows
4603} -result {}
4604test panedwindow-23.5 {ConfigurePanes, after win isn't managed by panedwin} -setup {
4605	deleteWindows
4606} -body {
4607    panedwindow .p
4608    button .b
4609    button .c
4610    .p add .b -after .c
4611} -cleanup {
4612	deleteWindows
4613} -returnCodes error -result {window ".c" is not managed by .p}
4614test panedwindow-23.6 {ConfigurePanes, before win isn't managed by panedwin} -setup {
4615	deleteWindows
4616} -body {
4617    panedwindow .p
4618    button .b
4619    button .c
4620    .p add .b -before .c
4621} -cleanup {
4622	deleteWindows
4623} -returnCodes error -result {window ".c" is not managed by .p}
4624test panedwindow-23.7 {ConfigurePanes, -after {} is a no-op} -setup {
4625	deleteWindows
4626} -body {
4627    panedwindow .p
4628    .p add [button .b] [button .c]
4629    .p paneconfigure .b -after {}
4630    .p panes
4631} -cleanup {
4632	deleteWindows
4633} -result {.b .c}
4634test panedwindow-23.8 {ConfigurePanes, -before {} is a no-op} -setup {
4635	deleteWindows
4636} -body {
4637    panedwindow .p
4638    .p add [button .b] [button .c]
4639    .p paneconfigure .b -before {}
4640    .p panes
4641} -cleanup {
4642	deleteWindows
4643} -result {.b .c}
4644test panedwindow-23.9 {ConfigurePanes, new panes are added} -setup {
4645	deleteWindows
4646} -body {
4647    panedwindow .p
4648    .p add [button .b] [button .c]
4649    .p panes
4650} -cleanup {
4651	deleteWindows
4652} -result {.b .c}
4653test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup {
4654	deleteWindows
4655} -body {
4656    panedwindow .p
4657    .p add [button .b] [button .c] -sticky ne -height 5 -width 5 -minsize 10
4658    set result {}
4659    foreach w {.b .c} {
4660        set val {}
4661        foreach option {-sticky -height -width -minsize} {
4662            lappend val $option [.p panecget $w $option]
4663        }
4664        lappend result $w $val
4665    }
4666    return $result
4667} -cleanup {
4668	deleteWindows
4669} -result {.b {-sticky ne -height 5 -width 5 -minsize 10} .c {-sticky ne -height 5 -width 5 -minsize 10}}
4670
4671test panedwindow-23.11 {ConfigurePanes, existing panes are reconfigured} -setup {
4672	deleteWindows
4673} -body {
4674    panedwindow .p
4675    .p add [button .b] -sticky nw -height 10
4676    .p add .b [button .c] -sticky se -height 2
4677    list [.p panes] [.p panecget .b -sticky] [.p panecget .b -height] \
4678	    [.p panecget .c -sticky] [.p panecget .c -height]
4679} -cleanup {
4680	deleteWindows
4681} -result [list {.b .c} es 2 es 2]
4682test panedwindow-23.12 {ConfigurePanes, widgets added to end by default} -setup {
4683	deleteWindows
4684} -body {
4685    panedwindow .p
4686    .p add [button .b]
4687    .p add [button .c]
4688    .p add [button .d]
4689    .p panes
4690} -cleanup {
4691	deleteWindows
4692} -result {.b .c .d}
4693test panedwindow-23.13 {ConfigurePanes, -after, single addition} -setup {
4694	deleteWindows
4695} -body {
4696    panedwindow .p
4697    button .a
4698    button .b
4699    button .c
4700
4701    .p add .a .b
4702    .p add .c -after .a
4703    .p panes
4704} -cleanup {
4705	deleteWindows
4706} -result {.a .c .b}
4707test panedwindow-23.14 {ConfigurePanes, -after, multiple additions} -setup {
4708	deleteWindows
4709} -body {
4710    panedwindow .p
4711    button .a
4712    button .b
4713    button .c
4714    button .d
4715
4716    .p add .a .b
4717    .p add .c .d -after .a
4718    .p panes
4719} -cleanup {
4720	deleteWindows
4721} -result {.a .c .d .b}
4722test panedwindow-23.15 {ConfigurePanes, -after, relocates existing widget} -setup {
4723	deleteWindows
4724} -body {
4725    panedwindow .p
4726    button .a
4727    button .b
4728    button .c
4729    button .d
4730
4731    .p add .a .b .c .d
4732    .p add .d -after .a
4733    .p panes
4734} -cleanup {
4735	deleteWindows
4736} -result {.a .d .b .c}
4737test panedwindow-23.16 {ConfigurePanes, -after, relocates existing widgets} -setup {
4738	deleteWindows
4739} -body {
4740    panedwindow .p
4741    button .a
4742    button .b
4743    button .c
4744    button .d
4745
4746    .p add .a .b .c .d
4747    .p add .b .d -after .a
4748    .p panes
4749} -cleanup {
4750	deleteWindows
4751} -result {.a .b .d .c}
4752test panedwindow-23.17 {ConfigurePanes, -after, relocates existing widgets} -setup {
4753	deleteWindows
4754} -body {
4755    panedwindow .p
4756    button .a
4757    button .b
4758    button .c
4759    button .d
4760
4761    .p add .a .b .c .d
4762    .p add .d .a -after .b
4763    .p panes
4764} -cleanup {
4765	deleteWindows
4766} -result {.b .d .a .c}
4767test panedwindow-23.18 {ConfigurePanes, -after, relocates existing widgets} -setup {
4768	deleteWindows
4769} -body {
4770    panedwindow .p
4771    button .a
4772    button .b
4773    button .c
4774    button .d
4775
4776    .p add .a .b .c .d
4777    .p add .d .a -after .a
4778    .p panes
4779} -cleanup {
4780	deleteWindows
4781} -result {.d .a .b .c}
4782test panedwindow-23.19 {ConfigurePanes, -after, after last window} -setup {
4783	deleteWindows
4784} -body {
4785    panedwindow .p
4786    button .a
4787    button .b
4788    button .c
4789    button .d
4790
4791    .p add .a .b .c
4792    .p add .d -after .c
4793    .p panes
4794} -cleanup {
4795	deleteWindows
4796} -result {.a .b .c .d}
4797test panedwindow-23.20 {ConfigurePanes, -before, before first window} -setup {
4798	deleteWindows
4799} -body {
4800    panedwindow .p
4801    button .a
4802    button .b
4803    button .c
4804    button .d
4805
4806    .p add .a .b .c
4807    .p add .d -before .a
4808    .p panes
4809} -cleanup {
4810	deleteWindows
4811} -result {.d .a .b .c}
4812test panedwindow-23.21 {ConfigurePanes, -before, relocate existing windows} -setup {
4813	deleteWindows
4814} -body {
4815    panedwindow .p
4816    button .a
4817    button .b
4818    button .c
4819    button .d
4820
4821    .p add .a .b .c
4822    .p add .d .b -before .a
4823    .p panes
4824} -cleanup {
4825	deleteWindows
4826} -result {.d .b .a .c}
4827test panedwindow-23.22 {ConfigurePanes, pane specified multiple times} -setup {
4828	deleteWindows
4829} -body {
4830    # This test should not cause a core dump
4831
4832    panedwindow .p
4833    button .a
4834    button .b
4835    button .c
4836
4837    .p add .a .a .b .c
4838    .p panes
4839} -cleanup {
4840	deleteWindows
4841} -result {.a .b .c}
4842test panedwindow-23.23 {ConfigurePanes, pane specified multiple times} -setup {
4843	deleteWindows
4844} -body {
4845    # This test should not cause a core dump
4846
4847    panedwindow .p
4848    button .a
4849    button .b
4850    button .c
4851
4852    .p add .a .a .b .c
4853    .p add .a .b .a -after .c
4854    .p panes
4855} -cleanup {
4856	deleteWindows
4857} -result {.c .a .b}
4858test panedwindow-23.24 {ConfigurePanes, panedwindow cannot manage toplevels} -setup {
4859	deleteWindows
4860} -body {
4861    panedwindow .p
4862    toplevel .t
4863    .p add .t
4864} -cleanup {
4865	deleteWindows
4866} -returnCodes error -result {can't add toplevel .t to .p}
4867test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup {
4868	deleteWindows
4869} -body {
4870    panedwindow .p
4871    frame .f
4872    button .f.b
4873   .p add .f.b
4874} -cleanup {
4875	deleteWindows
4876} -returnCodes error -result {can't add .f.b to .p}
4877test panedwindow-23.26 {ConfigurePanes, restrict possible panes} -setup {
4878	deleteWindows
4879} -body {
4880    frame .f
4881    panedwindow .f.p
4882    button .b
4883    .f.p add .b
4884} -cleanup {
4885	deleteWindows
4886} -result {}
4887test panedwindow-23.27 {ConfigurePanes, restrict possible panes} -setup {
4888	deleteWindows
4889} -body {
4890    panedwindow .p
4891    button .p.b
4892    .p add .p.b
4893} -cleanup {
4894	deleteWindows
4895} -result {}
4896test panedwindow-23.28 {ConfigurePanes, restrict possible panes} -setup {
4897	deleteWindows
4898} -body {
4899    frame .f
4900    frame .f.f
4901    frame .f.f.f
4902    panedwindow .f.f.f.p
4903    button .b
4904    .f.f.f.p add .b
4905} -cleanup {
4906	deleteWindows
4907} -result {}
4908test panedwindow-23.29 {ConfigurePanes, -hide works} -setup {
4909	deleteWindows
4910} -body {
4911	panedwindow .p -showhandle false
4912	frame .f1 -width 40 -height 100 -bg red
4913	frame .f2 -width 40 -height 100 -bg white
4914	frame .f3 -width 40 -height 100 -bg blue
4915	frame .f4 -width 40 -height 100 -bg green
4916	.p add .f1 .f2 .f3 .f4
4917	pack .p
4918	update
4919	set result [list]
4920	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
4921		[winfo ismapped .f3] [winfo ismapped .f4]
4922	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4923		[winfo width .f4] [winfo width .p]
4924	.p paneconfigure .f2 -hide 1
4925	update
4926	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
4927		[winfo ismapped .f3] [winfo ismapped .f4]
4928	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4929		[winfo width .f4] [winfo width .p]
4930} -cleanup {
4931    deleteWindows
4932} -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
4933test panedwindow-23.30 {ConfigurePanes, -hide works} -setup {
4934	deleteWindows
4935} -body {
4936	panedwindow .p -showhandle false -width 130 -height 100
4937	frame .f1 -width 40 -bg red
4938	frame .f2 -width 40 -bg white
4939	frame .f3 -width 40 -bg blue
4940	frame .f4 -width 40 -bg green
4941	.p add .f1 .f2 .f3 .f4
4942	pack .p
4943	update
4944	set result [list]
4945	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
4946		[winfo ismapped .f3] [winfo ismapped .f4]
4947	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4948		[winfo width .f4] [winfo width .p]
4949	.p paneconfigure .f2 -hide 1
4950	update
4951	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
4952		[winfo ismapped .f3] [winfo ismapped .f4]
4953	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4954		[winfo width .f4] [winfo width .p]
4955} -cleanup {
4956    deleteWindows
4957} -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130}
4958test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup {
4959	deleteWindows
4960} -body {
4961    panedwindow .p1 -sashrelief raised
4962    panedwindow .p2 -sashrelief raised
4963    label .l1 -text Label1
4964    label .l2 -text Label2
4965    label .l3 -text Label3
4966    .p2 add .l2 -sticky nsew
4967    .p2 add .l3 -sticky nsew
4968    .p1 add .p2 -sticky nsew
4969    .p1 add .l1 -sticky nsew
4970    pack .p1 -side top -expand 1 -fill both
4971	update
4972	set result [list]
4973	lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
4974		    [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
4975    .p2 paneconfigure .l1 -hide 1
4976	update
4977	lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
4978		    [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
4979    .p1 paneconfigure .p2 -hide 1
4980	update
4981	lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
4982		    [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
4983    .p1 paneconfigure .p2 -hide 0
4984	update
4985	lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
4986		    [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
4987} -cleanup {
4988    deleteWindows
4989} -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}}
4990test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup {
4991	deleteWindows
4992} -body {
4993	panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0
4994	frame .f1 -width 50 -bg red
4995	frame .f2 -width 50 -bg green
4996	frame .f3 -width 50 -bg blue
4997	.p add .f1 .f2 .f3
4998	pack .p
4999	update
5000	set result [list]
5001	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
5002	.p paneconfigure .f2 -hide 1
5003	update
5004    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
5005} -cleanup {
5006    deleteWindows
5007} -result {50 50 94 50 50 147}
5008test panedwindow-23.32 {ConfigurePanes, -hide works, last pane stretches} -setup {
5009	deleteWindows
5010} -body {
5011	panedwindow .p -showhandle false -width 200 -height 200 \
5012		-borderwidth 0 -orient vertical
5013	frame .f1 -height 50 -bg red
5014	frame .f2 -height 50 -bg green
5015	frame .f3 -height 50 -bg blue
5016	.p add .f1 .f2 .f3
5017	pack .p
5018	update
5019	set result [list]
5020	lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
5021	.p paneconfigure .f2 -hide 1
5022	update
5023	lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
5024} -cleanup {
5025    deleteWindows
5026} -result {50 50 94 50 50 147}
5027
5028test panedwindow-23.33 {ConfigurePanes, -stretch first} -setup {
5029	deleteWindows
5030} -body {
5031	panedwindow .p -showhandle false -height 100 -width 182
5032	frame .f1 -width 40 -bg red
5033	frame .f2 -width 40 -bg white
5034	frame .f3 -width 40 -bg blue
5035	frame .f4 -width 40 -bg green
5036	.p add .f1 .f2 .f3 .f4 -stretch first
5037	pack .p
5038	update
5039	set result [list]
5040	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5041		[winfo width .f4]
5042	.p paneconfigure .f2 -hide 1
5043	update
5044	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5045		[winfo width .f4]
5046} -cleanup {
5047    deleteWindows
5048} -result {51 40 40 40 94 40 40 40}
5049test panedwindow-23.34 {ConfigurePanes, -stretch middle} -setup {
5050	deleteWindows
5051} -body {
5052	panedwindow .p -showhandle false -height 100 -width 182
5053	frame .f1 -width 40 -bg red
5054	frame .f2 -width 40 -bg white
5055	frame .f3 -width 40 -bg blue
5056	frame .f4 -width 40 -bg green
5057	.p add .f1 .f2 .f3 .f4 -stretch middle
5058	pack .p
5059	update
5060	set result [list]
5061	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5062		[winfo width .f4]
5063	.p paneconfigure .f2 -hide 1
5064	update
5065	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5066		[winfo width .f4]
5067} -cleanup {
5068    deleteWindows
5069} -result {40 45 46 40 40 45 94 40}
5070test panedwindow-23.35 {ConfigurePanes, -stretch always} -setup {
5071	deleteWindows
5072} -body {
5073	panedwindow .p -showhandle false -height 100 -width 182
5074	frame .f1 -width 40 -bg red
5075	frame .f2 -width 40 -bg white
5076	frame .f3 -width 40 -bg blue
5077	frame .f4 -width 40 -bg green
5078	.p add .f1 .f2 .f3 .f4 -stretch always
5079	pack .p
5080	update
5081	set result [list]
5082	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5083		[winfo width .f4]
5084	.p paneconfigure .f2 -hide 1
5085	update
5086	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5087		[winfo width .f4]
5088} -cleanup {
5089    deleteWindows
5090} -result {42 43 43 43 58 43 58 58}
5091test panedwindow-23.36 {ConfigurePanes, -stretch never} -setup {
5092	deleteWindows
5093} -body {
5094	panedwindow .p -showhandle false -height 100 -width 182
5095	frame .f1 -width 40 -bg red
5096	frame .f2 -width 40 -bg white
5097	frame .f3 -width 40 -bg blue
5098	frame .f4 -width 40 -bg green
5099	.p add .f1 .f2 .f3 .f4 -stretch never
5100	pack .p
5101	update
5102	set result [list]
5103	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5104		[winfo width .f4]
5105	.p paneconfigure .f2 -hide 1
5106	update
5107	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
5108		[winfo width .f4]
5109} -cleanup {
5110    deleteWindows
5111} -result {40 40 40 40 40 40 40 40}
5112
5113
5114test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup {
5115	deleteWindows
5116} -body {
5117    # Bug 928413
5118    set result {}
5119    panedwindow .pw
5120    label .pw.l1 -text Label1
5121    label .pw.l2 -text Label2
5122    label .pw.l3 -text Label3
5123    .pw add .pw.l1
5124    .pw add .pw.l3
5125    .pw add .pw.l2 -before .pw.l3
5126    lappend result [.pw panecget .pw.l2 -before]
5127    destroy .pw.l3
5128    lappend result [.pw panecget .pw.l2 -before]
5129    .pw paneconfigure .pw.l2 -before .pw.l1
5130    lappend result [.pw panecget .pw.l2 -before]
5131} -cleanup {
5132	deleteWindows
5133} -result {.pw.l3 {} .pw.l1}
5134
5135
5136test panedwindow-25.1 {DestroyPanedWindow} -setup {
5137	deleteWindows
5138} -body {
5139    # This test should not result in any memory leaks.
5140    panedwindow .p
5141    foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .q .r .s .t} {
5142	    .p add [button $w]
5143    }
5144    foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .p .q .r .s .t} {
5145	    destroy $w
5146    }
5147    set result {}
5148} -result {}
5149test panedwindow-25.2 {UnmapNotify and MapNotify events are propagated to panes} -setup {
5150    deleteWindows
5151} -body {
5152    panedwindow .pw
5153    .pw add [button .pw.b]
5154    pack .pw
5155    update
5156    set result [winfo ismapped .pw.b]
5157    pack forget .pw
5158    update
5159    lappend result [winfo ismapped .pw.b]
5160    lappend result [winfo ismapped .pw]
5161    pack .pw
5162    update
5163    lappend result [winfo ismapped .pw]
5164    lappend result [winfo ismapped .pw.b]
5165    destroy .pw .pw.b
5166    set result
5167} -cleanup {
5168	deleteWindows
5169} -result {1 0 0 1 1}
5170
5171
5172test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup {
5173	deleteWindows
5174} -body {
5175    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
5176    .p add [frame .f -bg red -width 20 -height 20] \
5177	    [frame .f2 -bg blue -width 20 -height 20]
5178    .p identify 0 0
5179} -cleanup {
5180	deleteWindows
5181} -result {}
5182test panedwindow-26.2 {PanedWindowIdentifyCoords, padding is included} -setup {
5183	deleteWindows
5184} -body {
5185    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
5186    .p add [frame .f -bg red -width 20 -height 20] \
5187	    [frame .f2 -bg blue -width 20 -height 20]
5188    .p identify 20 0
5189} -cleanup {
5190	deleteWindows
5191} -result {0 sash}
5192test panedwindow-26.3 {PanedWindowIdentifyCoords} -setup {
5193	deleteWindows
5194} -body {
5195    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
5196    .p add [frame .f -bg red -width 20 -height 20] \
5197	    [frame .f2 -bg blue -width 20 -height 20]
5198    .p identify 22 0
5199} -cleanup {
5200	deleteWindows
5201} -result {0 sash}
5202test panedwindow-26.4 {PanedWindowIdentifyCoords} -setup {
5203	deleteWindows
5204} -body {
5205    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
5206    .p add [frame .f -bg red -width 20 -height 20] \
5207	    [frame .f2 -bg blue -width 20 -height 20]
5208    .p identify 24 0
5209} -cleanup {
5210	deleteWindows
5211} -result {0 sash}
5212test panedwindow-26.5 {PanedWindowIdentifyCoords} -setup {
5213	deleteWindows
5214} -body {
5215    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
5216    .p add [frame .f -bg red -width 20 -height 20] \
5217	    [frame .f2 -bg blue -width 20 -height 20]
5218    .p identify 26 0
5219} -cleanup {
5220	deleteWindows
5221} -result {0 sash}
5222test panedwindow-26.6 {PanedWindowIdentifyCoords} -setup {
5223	deleteWindows
5224} -body {
5225    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
5226    .p add [frame .f -bg red -width 20 -height 20] \
5227	    [frame .f2 -bg blue -width 20 -height 20]
5228    .p identify 26 -1
5229} -cleanup {
5230	deleteWindows
5231} -result {}
5232test panedwindow-26.7 {PanedWindowIdentifyCoords} -setup {
5233	deleteWindows
5234} -body {
5235    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
5236    .p add [frame .f -bg red -width 20 -height 20] \
5237	    [frame .f2 -bg blue -width 20 -height 20]
5238    .p identify 26 100
5239} -cleanup {
5240	deleteWindows
5241} -result {}
5242test panedwindow-26.8 {PanedWindowIdentifyCoords} -setup {
5243	deleteWindows
5244} -body {
5245    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5246	    -handlesize 6
5247    .p add [frame .f -bg red -width 20 -height 20] \
5248	    [frame .f2 -bg blue -width 20 -height 20]
5249    .p identify 22 4
5250} -cleanup {
5251	deleteWindows
5252} -result {0 sash}
5253test panedwindow-26.9 {PanedWindowIdentifyCoords} -setup {
5254	deleteWindows
5255} -body {
5256    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5257	    -handlesize 6
5258    .p add [frame .f -bg red -width 20 -height 20] \
5259	    [frame .f2 -bg blue -width 20 -height 20]
5260    .p identify 22 5
5261} -cleanup {
5262	deleteWindows
5263} -result {0 handle}
5264test panedwindow-26.10 {PanedWindowIdentifyCoords} -setup {
5265	deleteWindows
5266} -body {
5267    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5268	    -handlesize 8
5269    .p add [frame .f -bg red -width 20 -height 20] \
5270	    [frame .f2 -bg blue -width 20 -height 20]
5271    .p identify 20 5
5272} -cleanup {
5273	deleteWindows
5274} -result {0 handle}
5275test panedwindow-26.11 {PanedWindowIdentifyCoords} -setup {
5276	deleteWindows
5277} -body {
5278    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5279	    -handlesize 8
5280    .p add [frame .f -bg red -width 20 -height 20] \
5281	    [frame .f2 -bg blue -width 20 -height 20]
5282    .p identify 20 0
5283} -cleanup {
5284	deleteWindows
5285} -result {0 sash}
5286test panedwindow-26.12 {PanedWindowIdentifyCoords} -setup {
5287	deleteWindows
5288} -body {
5289    panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2
5290    .p add [frame .f -bg red -width 20 -height 20] \
5291	    [frame .f2 -bg blue -width 20 -height 20] \
5292	    [frame .f3 -bg green -width 20 -height 20]
5293    .p identify 48 0
5294} -cleanup {
5295	deleteWindows
5296} -result {1 sash}
5297test panedwindow-26.13 {identify subcommand errors} -setup {
5298	deleteWindows
5299} -body {
5300    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4
5301    .p identify
5302} -cleanup {
5303	deleteWindows
5304} -returnCodes error -result {wrong # args: should be ".p identify x y"}
5305test panedwindow-26.14 {identify subcommand errors} -setup {
5306	deleteWindows
5307} -body {
5308    panedwindow .p
5309    .p identify foo bar
5310} -cleanup {
5311	deleteWindows
5312} -returnCodes error -result {expected integer but got "foo"}
5313test panedwindow-26.15 {identify subcommand errors} -setup {
5314	deleteWindows
5315} -body {
5316    panedwindow .p
5317    .p identify 0 bar
5318} -cleanup {
5319	deleteWindows
5320} -returnCodes error -result {expected integer but got "bar"}
5321test panedwindow-26.16 {PanedWindowIdentifyCoords} -setup {
5322	deleteWindows
5323} -body {
5324    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5325    .p add [frame .f -bg red -width 20 -height 20] \
5326	    [frame .f2 -bg blue -width 20 -height 20]
5327    .p identify 0 0
5328} -cleanup {
5329	deleteWindows
5330} -result {}
5331test panedwindow-26.17 {PanedWindowIdentifyCoords, padding is included} -setup {
5332	deleteWindows
5333} -body {
5334    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5335    .p add [frame .f -bg red -width 20 -height 20] \
5336	    [frame .f2 -bg blue -width 20 -height 20]
5337    .p identify 0 20
5338} -cleanup {
5339	deleteWindows
5340} -result {0 sash}
5341test panedwindow-26.18 {PanedWindowIdentifyCoords} -setup {
5342	deleteWindows
5343} -body {
5344    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5345    .p add [frame .f -bg red -width 20 -height 20] \
5346	    [frame .f2 -bg blue -width 20 -height 20]
5347    .p identify 0 22
5348} -cleanup {
5349	deleteWindows
5350} -result {0 sash}
5351test panedwindow-26.19 {PanedWindowIdentifyCoords} -setup {
5352	deleteWindows
5353} -body {
5354    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5355    .p add [frame .f -bg red -width 20 -height 20] \
5356	    [frame .f2 -bg blue -width 20 -height 20]
5357    .p identify 0 24
5358} -cleanup {
5359	deleteWindows
5360} -result {0 sash}
5361test panedwindow-26.20 {PanedWindowIdentifyCoords} -setup {
5362	deleteWindows
5363} -body {
5364    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5365    .p add [frame .f -bg red -width 20 -height 20] \
5366	    [frame .f2 -bg blue -width 20 -height 20]
5367    .p identify 0 26
5368} -cleanup {
5369	deleteWindows
5370} -result {0 sash}
5371test panedwindow-26.21 {PanedWindowIdentifyCoords} -setup {
5372	deleteWindows
5373} -body {
5374    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5375    .p add [frame .f -bg red -width 20 -height 20] \
5376	    [frame .f2 -bg blue -width 20 -height 20]
5377    .p identify -1 26
5378} -cleanup {
5379	deleteWindows
5380} -result {}
5381test panedwindow-26.22 {PanedWindowIdentifyCoords} -setup {
5382	deleteWindows
5383} -body {
5384    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5385    .p add [frame .f -bg red -width 20 -height 20] \
5386	    [frame .f2 -bg blue -width 20 -height 20]
5387    .p identify 100 26
5388} -cleanup {
5389	deleteWindows
5390} -result {}
5391test panedwindow-26.23 {PanedWindowIdentifyCoords} -setup {
5392	deleteWindows
5393} -body {
5394    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5395	    -handlesize 6 -orient vertical
5396    .p add [frame .f -bg red -width 20 -height 20] \
5397	    [frame .f2 -bg blue -width 20 -height 20]
5398    .p identify 4 22
5399} -cleanup {
5400	deleteWindows
5401} -result {0 sash}
5402test panedwindow-26.24 {PanedWindowIdentifyCoords} -setup {
5403	deleteWindows
5404} -body {
5405    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5406	    -handlesize 6 -orient vertical
5407    .p add [frame .f -bg red -width 20 -height 20] \
5408	    [frame .f2 -bg blue -width 20 -height 20]
5409    .p identify 5 22
5410} -cleanup {
5411	deleteWindows
5412} -result {0 handle}
5413test panedwindow-26.25 {PanedWindowIdentifyCoords} -setup {
5414	deleteWindows
5415} -body {
5416    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5417	    -handlesize 8 -orient vertical
5418    .p add [frame .f -bg red -width 20 -height 20] \
5419	    [frame .f2 -bg blue -width 20 -height 20]
5420    .p identify 5 20
5421} -cleanup {
5422	deleteWindows
5423} -result {0 handle}
5424test panedwindow-26.26 {PanedWindowIdentifyCoords} -setup {
5425	deleteWindows
5426} -body {
5427    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
5428	    -handlesize 8 -orient vertical
5429    .p add [frame .f -bg red -width 20 -height 20] \
5430	    [frame .f2 -bg blue -width 20 -height 20]
5431    .p identify 0 20
5432} -cleanup {
5433	deleteWindows
5434} -result {0 sash}
5435test panedwindow-26.27 {PanedWindowIdentifyCoords} -setup {
5436	deleteWindows
5437} -body {
5438    panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
5439    .p add [frame .f -bg red -width 20 -height 20] \
5440	    [frame .f2 -bg blue -width 20 -height 20] \
5441	    [frame .f3 -bg green -width 20 -height 20]
5442    .p identify 0 48
5443} -cleanup {
5444	deleteWindows
5445} -result {1 sash}
5446
5447
5448test panedwindow-27.1 {destroy the window cleanly on error [Bug #616589]} -setup {
5449	deleteWindows
5450} -body {
5451    panedwindow .p -bogusopt bogus
5452} -cleanup {
5453	deleteWindows
5454} -returnCodes error -result {unknown option "-bogusopt"}
5455test panedwindow-27.2 {destroy the window cleanly on rename [Bug #616589]} -setup {
5456	deleteWindows
5457} -body {
5458    destroy .p
5459    panedwindow .p
5460    rename .p {}
5461    winfo exists .p
5462} -cleanup {
5463	deleteWindows
5464} -result {0}
5465
5466
5467test panedwindow-28.1 {resizing width} -setup {
5468	deleteWindows
5469} -body {
5470    panedwindow .p -bd 5
5471    frame .f1 -width 100 -height 50 -bg blue
5472    frame .f2 -width 100 -height 50 -bg red
5473
5474    .p add .f1 -sticky news
5475    .p add .f2 -sticky news
5476    pack .p -side top -fill both -expand 1
5477    wm geometry . ""
5478    update
5479    # Note the width
5480    set a [winfo width .f2]
5481    # Increase the size by 10
5482    regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
5483    wm geometry . [expr {$w + 10}]x$h
5484    update
5485    set b "$a [winfo width .f2]"
5486} -cleanup {
5487    deleteWindows
5488} -result {100 110}
5489
5490test panedwindow-28.2 {resizing height} -setup {
5491	deleteWindows
5492} -body {
5493    panedwindow .p -orient vertical -bd 5
5494    frame .f1 -width 50 -height 100 -bg blue
5495    frame .f2 -width 50 -height 100 -bg red
5496
5497    .p add .f1 -sticky news
5498    .p add .f2 -sticky news
5499    pack .p -side top -fill both -expand 1
5500    wm geometry . ""
5501    update
5502    # Note the height
5503    set a [winfo height .f2]
5504    # Increase the size by 10
5505    regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
5506    wm geometry . ${w}x[expr {$h + 10}]
5507    update
5508    set b "$a [winfo height .f2]"
5509} -cleanup {
5510    deleteWindows
5511} -result {100 110}
5512
5513
5514test panedwindow-29.1 {display on depths other than the default one} -constraints {
5515    pseudocolor8 haveTruecolor24
5516} -setup {
5517	deleteWindows
5518} -body {
5519	toplevel .t -visual {truecolor 24}
5520	pack [panedwindow .t.p]
5521	.t.p add [frame .t.p.f1] [frame .t.p.f2]
5522	update
5523	# If we got here, we didn't crash and that's good
5524} -cleanup {
5525    deleteWindows
5526} -result {}
5527test panedwindow-29.2 {display on depths other than the default one} -constraints {
5528    pseudocolor8 haveTruecolor24
5529} -setup {
5530    deleteWindows
5531} -body {
5532	toplevel .t -visual {pseudocolor 8}
5533	pack [frame .t.f -visual {truecolor 24}]
5534	pack [panedwindow .t.f.p]
5535	.t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5]
5536	update
5537	.t.f.p proxy place 1 1
5538	update
5539	.t.f.p proxy forget
5540	update
5541	# If we got here, we didn't crash and that's good
5542} -cleanup {
5543    deleteWindows
5544} -result {}
5545
5546
5547# cleanup
5548cleanupTests
5549return
5550
5551
5552