head	1.23;
access;
symbols
	core-8-5-9:1.22
	core-8-5-8:1.22
	macosx-cocoa-merge:1.23
	macosx-cocoa-premerge:1.23
	macosx-carbon-freeze:1.23
	core-8-5-7:1.22
	core-8-5-6:1.22
	core-8-6-b1:1.23
	core-8-6-a3:1.23
	core-8-5-5:1.22
	core-8-6-a2:1.23
	core-8-5-4:1.22
	core-8-5-3:1.22
	core-8-6-a1:1.22
	core-8-4-19:1.8.2.4
	core-8-5-branch:1.22.0.2
	core-8-5-2:1.22
	core-8-4-18:1.8.2.4
	core-8-5-1:1.22
	core-8-4-17:1.8.2.4
	core-8-5-0:1.22
	core-8-5-b3:1.21
	core-8-5-b2:1.20
	core-8-4-16:1.8.2.4
	core-8-5-b1:1.20
	core-stablilizer-merge:1.20
	core-stabilizer-branch:1.20.0.2
	core-stabilizer-merge:1.22
	core-8-4-15:1.8.2.4
	core-8-5-a6:1.20
	core-8-5-a5:1.20
	core-8-4-14:1.8.2.4
	core-8-5-a4:1.20
	core-8-4-13:1.8.2.4
	core-8-4-12:1.8.2.4
	core-8-4-11:1.8.2.4
	core-8-5-a3:1.20
	core-8-4-10:1.8.2.4
	core-8-4-9-branch:1.8.2.3.0.2
	core-8-5-a2:1.19
	core-8-4-9:1.8.2.3
	core-8-4-8:1.8.2.3
	core-8-4-7:1.8.2.3
	core-8-5-a1:1.12
	core-8-4-6:1.8.2.2
	core-8-4-5:1.8.2.2
	mistachkin-dev-branch:1.12.0.2
	core-8-4-4:1.8.2.2
	core-8-4-3:1.8
	core-8-4-branch:1.8.0.2
	core-8-4-2:1.8
	core-8-4-1:1.5
	core-8-4-0:1.4
	macosx-8-4-merge-2002-08-31-trunk:1.4
	macosx-8-4-premerge-2002-08-31-branch:1.1.4.3
	macosx-8-4-premerge-2002-08-31-trunk:1.4
	macosx-8-4-merge-2002-08-30-branch:1.1.4.3
	macosx-8-4-merge-2002-08-30-trunk:1.4
	macosx-8-4-merge-2002-08-20-branch:1.1.4.3
	macosx-8-4-merge-2002-08-20-trunk:1.4
	core-8-4-b2:1.4
	core-8-4-b1:1.2
	macosx-8-4-branch:1.1.0.4
	core-8-4-win-speedup:1.1.0.2
	core-8-4-a4:1.1;
locks; strict;
comment	@# @;


1.23
date	2008.08.21.11.19.33;	author aniap;	state Exp;
branches;
next	1.22;

1.22
date	2007.12.13.15.27.54;	author dgp;	state Exp;
branches;
next	1.21;

1.21
date	2007.10.30.01.57.55;	author hobbs;	state Exp;
branches;
next	1.20;

1.20
date	2005.05.31.05.23.44;	author hobbs;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	2004.12.04.00.04.41;	author dkf;	state Exp;
branches;
next	1.18;

1.18
date	2004.10.26.08.07.28;	author dkf;	state Exp;
branches;
next	1.17;

1.17
date	2004.10.25.15.22.16;	author dkf;	state Exp;
branches;
next	1.16;

1.16
date	2004.10.24.17.22.55;	author dkf;	state Exp;
branches;
next	1.15;

1.15
date	2004.09.10.06.58.42;	author hobbs;	state Exp;
branches;
next	1.14;

1.14
date	2004.05.23.17.34.49;	author dkf;	state Exp;
branches;
next	1.13;

1.13
date	2004.05.03.19.16.11;	author hobbs;	state Exp;
branches;
next	1.12;

1.12
date	2003.07.18.10.02.03;	author dkf;	state Exp;
branches;
next	1.11;

1.11
date	2003.07.17.00.39.53;	author hobbs;	state Exp;
branches;
next	1.10;

1.10
date	2003.05.21.15.31.01;	author dkf;	state Exp;
branches;
next	1.9;

1.9
date	2003.04.01.21.06.49;	author dgp;	state Exp;
branches;
next	1.8;

1.8
date	2003.02.21.11.48.56;	author dkf;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2003.02.21.01.57.51;	author hobbs;	state Exp;
branches;
next	1.6;

1.6
date	2003.02.20.21.08.30;	author pspjuth;	state Exp;
branches;
next	1.5;

1.5
date	2002.09.30.18.55.57;	author hobbs;	state Exp;
branches;
next	1.4;

1.4
date	2002.08.08.01.43.44;	author hobbs;	state Exp;
branches;
next	1.3;

1.3
date	2002.07.13.20.28.35;	author dgp;	state Exp;
branches;
next	1.2;

1.2
date	2002.06.19.23.17.17;	author hobbs;	state Exp;
branches;
next	1.1;

1.1
date	2002.02.22.02.41.17;	author hobbs;	state Exp;
branches
	1.1.2.1
	1.1.4.1;
next	;

1.1.2.1
date	2002.04.02.20.57.58;	author hobbs;	state Exp;
branches;
next	;

1.1.4.1
date	2002.06.10.05.08.00;	author wolfsuit;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	2002.06.10.05.38.26;	author wolfsuit;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	2002.08.20.20.27.15;	author das;	state Exp;
branches;
next	;

1.8.2.1
date	2003.07.17.00.37.03;	author hobbs;	state Exp;
branches;
next	1.8.2.2;

1.8.2.2
date	2003.07.18.09.53.16;	author dkf;	state Exp;
branches;
next	1.8.2.3;

1.8.2.3
date	2004.05.03.19.17.39;	author hobbs;	state Exp;
branches;
next	1.8.2.4;

1.8.2.4
date	2005.05.31.05.22.06;	author hobbs;	state Exp;
branches;
next	;

1.20.2.1
date	2007.11.01.16.37.24;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.23
log
@Update to tcltest2
@
text
@# This file is a Tcl script to test entry widgets in Tk.  It is
# organized in the standard fashion for Tcl tests.
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @@(#) $Id: panedwindow.test,v 1.22 2007/12/13 15:27:54 dgp Exp $

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test

deleteWindows
# Panedwindow for tests 1.*
panedwindow .p
# Buttons for tests 1.33 - 1.52
.p add [button .b]
.p add [button .c]
test panedwindow-1.1 {configuration options: -background (good)} -body {
    .p configure -background #ff0000
    list [lindex [.p configure -background] 4] [.p cget -background]
} -cleanup {
    .p configure -background [lindex [.p configure -background] 3]
} -result {{#ff0000} #ff0000}
test panedwindow-1.2 {configuration options: -background (bad)} -body {
    .p configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test panedwindow-1.3 {configuration options: -bd (good)} -body {
    .p configure -bd 4
    list [lindex [.p configure -bd] 4] [.p cget -bd]
} -cleanup {
    .p configure -bd [lindex [.p configure -bd] 3]
} -result {4 4}
test panedwindow-1.4 {configuration options: -bd (bad)} -body {
    .p configure -bd badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.5 {configuration options: -bg (good)} -body {
    .p configure -bg #ff0000
    list [lindex [.p configure -bg] 4] [.p cget -bg]
} -cleanup {
    .p configure -bg [lindex [.p configure -bg] 3]
} -result {{#ff0000} #ff0000}
test panedwindow-1.6 {configuration options: -bg (bad)} -body {
    .p configure -bg non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test panedwindow-1.7 {configuration options: -borderwidth (good)} -body {
    .p configure -borderwidth 1.3
    list [lindex [.p configure -borderwidth] 4] [.p cget -borderwidth]
} -cleanup {
    .p configure -borderwidth [lindex [.p configure -borderwidth] 3]
} -result {1 1}
test panedwindow-1.8 {configuration options: -borderwidth (bad)} -body {
    .p configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.9 {configuration options: -cursor (good)} -body {
    .p configure -cursor arrow
    list [lindex [.p configure -cursor] 4] [.p cget -cursor]
} -cleanup {
    .p configure -cursor [lindex [.p configure -cursor] 3]
} -result {arrow arrow}
test panedwindow-1.10 {configuration options: -cursor (bad)} -body {
    .p configure -cursor badValue
} -returnCodes error -result {bad cursor spec "badValue"}
test panedwindow-1.11 {configuration options: -handlesize (good)} -body {
    .p configure -handlesize 20
    list [lindex [.p configure -handlesize] 4] [.p cget -handlesize]
} -cleanup {
    .p configure -handlesize [lindex [.p configure -handlesize] 3]
} -result {20 20}
test panedwindow-1.12 {configuration options: -handlesize (bad)} -body {
    .p configure -handlesize badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.13 {configuration options: -height (good)} -body {
    .p configure -height 20
    list [lindex [.p configure -height] 4] [.p cget -height]
} -cleanup {
    .p configure -height [lindex [.p configure -height] 3]
} -result {20 20}
test panedwindow-1.14 {configuration options: -height (bad)} -body {
    .p configure -height badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.15 {configuration options: -opaqueresize (good)} -body {
    .p configure -opaqueresize true
    list [lindex [.p configure -opaqueresize] 4] [.p cget -opaqueresize]
} -cleanup {
    .p configure -opaqueresize [lindex [.p configure -opaqueresize] 3]
} -result {1 1}
test panedwindow-1.16 {configuration options: -opaqueresize (bad)} -body {
    .p configure -opaqueresize foo
} -returnCodes error -result {expected boolean value but got "foo"}
test panedwindow-1.17 {configuration options: -orient (good)} -body {
    .p configure -orient horizontal
    list [lindex [.p configure -orient] 4] [.p cget -orient]
} -cleanup {
    .p configure -orient [lindex [.p configure -orient] 3]
} -result {horizontal horizontal}
test panedwindow-1.18 {configuration options: -orient (bad)} -body {
    .p configure -orient badValue
} -returnCodes error -result {bad orient "badValue": must be horizontal or vertical}
test panedwindow-1.19 {configuration options: -relief (good)} -body {
    .p configure -relief groove
    list [lindex [.p configure -relief] 4] [.p cget -relief]
} -cleanup {
    .p configure -relief [lindex [.p configure -relief] 3]
} -result {groove groove}
test panedwindow-1.20 {configuration options: -relief (bad)} -body {
    .p configure -relief 1.5
} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
test panedwindow-1.21 {configuration options: -sashcursor (good)} -body {
    .p configure -sashcursor arrow
    list [lindex [.p configure -sashcursor] 4] [.p cget -sashcursor]
} -cleanup {
    .p configure -sashcursor [lindex [.p configure -sashcursor] 3]
} -result {arrow arrow}
test panedwindow-1.22 {configuration options: -sashcursor (bad)} -body {
    .p configure -sashcursor badValue
} -returnCodes error -result {bad cursor spec "badValue"}
test panedwindow-1.23 {configuration options: -sashpad (good)} -body {
    .p configure -sashpad 1.3
    list [lindex [.p configure -sashpad] 4] [.p cget -sashpad]
} -cleanup {
    .p configure -sashpad [lindex [.p configure -sashpad] 3]
} -result {1 1}
test panedwindow-1.24 {configuration options: -sashpad (bad)} -body {
    .p configure -sashpad badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.25 {configuration options: -sashrelief (good)} -body {
    .p configure -sashrelief groove
    list [lindex [.p configure -sashrelief] 4] [.p cget -sashrelief]
} -cleanup {
    .p configure -sashrelief [lindex [.p configure -sashrelief] 3]
} -result {groove groove}
test panedwindow-1.26 {configuration options: -sashrelief (bad)} -body {
    .p configure -sashrelief 1.5
} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
test panedwindow-1.27 {configuration options: -sashwidth (good)} -body {
    .p configure -sashwidth 10
    list [lindex [.p configure -sashwidth] 4] [.p cget -sashwidth]
} -cleanup {
    .p configure -sashwidth [lindex [.p configure -sashwidth] 3]
} -result {10 10}
test panedwindow-1.28 {configuration options: -sashwidth (bad)} -body {
    .p configure -sashwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.29 {configuration options: -showhandle (good)} -body {
    .p configure -showhandle true
    list [lindex [.p configure -showhandle] 4] [.p cget -showhandle]
} -cleanup {
    .p configure -showhandle [lindex [.p configure -showhandle] 3]
} -result {1 1}
test panedwindow-1.30 {configuration options: -showhandle (bad)} -body {
    .p configure -showhandle foo
} -returnCodes error -result {expected boolean value but got "foo"}
test panedwindow-1.31 {configuration options: -width (good)} -body {
    .p configure -width 402
    list [lindex [.p configure -width] 4] [.p cget -width]
} -cleanup {
    .p configure -width [lindex [.p configure -width] 3]
} -result {402 402}
test panedwindow-1.32 {configuration options: -width (bad)} -body {
    .p configure -width badValue
} -returnCodes error -result {bad screen distance "badValue"}

test panedwindow-1.33 {configuration options: -after (good)} -body {
    .p paneconfigure .b -after .c
    list [lindex [.p paneconfigure .b -after] 4] \
        [.p panecget .b -after]
} -cleanup {
    .p paneconfig .b -after [lindex [.p paneconfig .b -after] 3]
} -result {.c .c}
test panedwindow-1.34 {configuration options: -after (bad)} -body {
    .p paneconfigure .b -after badValue
} -returnCodes error -result {bad window path name "badValue"}
test panedwindow-1.35 {configuration options: -before (good)} -body {
    .p paneconfigure .b -before .c
    list [lindex [.p paneconfigure .b -before] 4] \
        [.p panecget .b -before]
} -cleanup {
    .p paneconfig .b -before [lindex [.p paneconfig .b -before] 3]
} -result {.c .c}
test panedwindow-1.36 {configuration options: -before (bad)} -body {
    .p paneconfigure .b -before badValue
} -returnCodes error -result {bad window path name "badValue"}
test panedwindow-1.37 {configuration options: -height (good)} -body {
    .p paneconfigure .b -height 10
    list [lindex [.p paneconfigure .b -height] 4] \
        [.p panecget .b -height]
} -cleanup {
    .p paneconfig .b -height [lindex [.p paneconfig .b -height] 3]
} -result {10 10}
test panedwindow-1.38 {configuration options: -height (bad)} -body {
    .p paneconfigure .b -height badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.39 {configuration options: -hide (good)} -body {
    .p paneconfigure .b -hide false
    list [lindex [.p paneconfigure .b -hide] 4] \
        [.p panecget .b -hide]
} -cleanup {
    .p paneconfig .b -hide [lindex [.p paneconfig .b -hide] 3]
} -result {0 0}
test panedwindow-1.40 {configuration options: -hide (bad)} -body {
    .p paneconfigure .b -hide foo
} -returnCodes error -result {expected boolean value but got "foo"}
test panedwindow-1.41 {configuration options: -minsize (good)} -body {
    .p paneconfigure .b -minsize 10
    list [lindex [.p paneconfigure .b -minsize] 4] \
        [.p panecget .b -minsize]
} -cleanup {
    .p paneconfig .b -minsize [lindex [.p paneconfig .b -minsize] 3]
} -result {10 10}
test panedwindow-1.42 {configuration options: -minsize (bad)} -body {
    .p paneconfigure .b -minsize badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.43 {configuration options: -padx (good)} -body {
    .p paneconfigure .b -padx 1.3
    list [lindex [.p paneconfigure .b -padx] 4] \
        [.p panecget .b -padx]
} -cleanup {
    .p paneconfig .b -padx [lindex [.p paneconfig .b -padx] 3]
} -result {1 1}
test panedwindow-1.44 {configuration options: -padx (bad)} -body {
    .p paneconfigure .b -padx badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.45 {configuration options: -pady (good)} -body {
    .p paneconfigure .b -pady 1.3
    list [lindex [.p paneconfigure .b -pady] 4] \
        [.p panecget .b -pady]
} -cleanup {
    .p paneconfig .b -pady [lindex [.p paneconfig .b -pady] 3]
} -result {1 1}
test panedwindow-1.46 {configuration options: -pady (bad)} -body {
    .p paneconfigure .b -pady badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.47 {configuration options: -sticky (good)} -body {
    .p paneconfigure .b -sticky nsew
    list [lindex [.p paneconfigure .b -sticky] 4] \
        [.p panecget .b -sticky]
} -cleanup {
    .p paneconfig .b -sticky [lindex [.p paneconfig .b -sticky] 3]
} -result {nesw nesw}
test panedwindow-1.48 {configuration options: -sticky (bad)} -body {
    .p paneconfigure .b -sticky abcd
} -returnCodes error -result {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w}
test panedwindow-1.49 {configuration options: -stretch (good)} -body {
    .p paneconfigure .b -stretch alw
    list [lindex [.p paneconfigure .b -stretch] 4] \
        [.p panecget .b -stretch]
} -cleanup {
    .p paneconfig .b -stretch [lindex [.p paneconfig .b -stretch] 3]
} -result {always always}
test panedwindow-1.50 {configuration options: -stretch (bad)} -body {
    .p paneconfigure .b -stretch foo
} -returnCodes error -result {bad stretch "foo": must be always, first, last, middle, or never}
test panedwindow-1.51 {configuration options: -width (good)} -body {
    .p paneconfigure .b -width 10
    list [lindex [.p paneconfigure .b -width] 4] \
        [.p panecget .b -width]
} -cleanup {
    .p paneconfig .b -width [lindex [.p paneconfig .b -width] 3]
} -result {10 10}
test panedwindow-1.52 {configuration options: -width (bad)} -body {
    .p paneconfigure .b -width badValue
} -returnCodes error -result {bad screen distance "badValue"}
deleteWindows


test panedwindow-2.1 {panedwindow widget command} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p foo
} -cleanup {
	deleteWindows
} -returnCodes error -result {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash}


test panedwindow-3.1 {panedwindow panes subcommand} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b]
    .p add [button .c]
    set result [list [.p panes]]
    .p forget .b
    lappend result [.p panes]
} -cleanup {
	deleteWindows
} -result [list [list .b .c] [list .c]]


test panedwindow-4.1 {forget subcommand} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p forget
} -cleanup {
	deleteWindows
} -returnCodes error -result {wrong # args: should be ".p forget widget ?widget ...?"}
test panedwindow-4.2 {forget subcommand, forget one from start} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b]
    .p add [button .c]
    set result [list [.p panes]]
    .p forget .b
    lappend result [.p panes]
} -cleanup {
	deleteWindows
} -result [list {.b .c} .c]
test panedwindow-4.3 {forget subcommand, forget one from end} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b]
    .p add [button .c]
    .p add [button .d]
    set result [list [.p panes]]
    .p forget .d
    update
    lappend result [.p panes]
} -cleanup {
	deleteWindows
} -result [list {.b .c .d} {.b .c}]
test panedwindow-4.4 {forget subcommand, forget multiple} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b]
    .p add [button .c]
    .p add [button .d]
    set result [list [.p panes]]
    .p forget .b .c
    update
    lappend result [.p panes]
} -cleanup {
	deleteWindows
} -result [list {.b .c .d} .d]
test panedwindow-4.5 {forget subcommand, panes are unmapped} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b]
    .p add [button .c]
    pack .p
    update
    set result [list [winfo ismapped .b] [winfo ismapped .c]]
    .p forget .b
    update
    lappend result [winfo ismapped .b] [winfo ismapped .c]
} -cleanup {
	deleteWindows
} -result [list 1 1 0 1]
test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
    .p add [frame .f -width 20 -height 20] [frame .g -width 20 -height 20]
    set result [list [winfo reqwidth .p]]
    .p forget .f
    lappend result [winfo reqwidth .p]
} -cleanup {
	deleteWindows
} -result [list 44 20]


test panedwindow-5.1 {sash subcommand} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash
} -cleanup {
	deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash option ?arg ...?"}
test panedwindow-5.2 {sash subcommand} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash foo
} -cleanup {
	deleteWindows
} -returnCodes error -result {bad option "foo": must be coord, dragto, mark, or place}


test panedwindow-6.1 {sash coord subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash coord
} -cleanup {
	deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash coord index"}
test panedwindow-6.2 {sash coord subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
    .p sash coord 0
} -cleanup {
	deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-6.3 {sash coord subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash coord foo
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-6.4 {sash coord subcommand sashes correctly placed} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
    .p add [frame .p.f -width 20 -height 20] \
	    [frame .p.f2 -width 20 -height 20] \
	    [frame .p.f3 -width 20 -height 20]
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 22 0]
test panedwindow-6.5 {sash coord subcommand sashes correctly placed} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
    .p add [frame .p.f -width 20 -height 20] \
	    [frame .p.f2 -width 20 -height 20] \
	    [frame .p.f3 -width 20 -height 20]
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 50 0]
test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
            -showhandle false
    .p add [frame .p.f -width 20 -height 20] \
	    [frame .p.f2 -width 20 -height 20] \
	    [frame .p.f3 -width 20 -height 20]
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 22]
test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
            -showhandle false
    .p add [frame .p.f -width 20 -height 20] \
	    [frame .p.f2 -width 20 -height 20] \
	    [frame .p.f3 -width 20 -height 20]
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 50]
test panedwindow-6.8 {sash coord subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    list [catch {.p sash coord -1} msg] $msg \
        [catch {.p sash coord  0} msg] $msg \
        [catch {.p sash coord  1} msg] $msg
} -cleanup {
	deleteWindows
} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-6.9 {sash coord subcommand, errors} -setup {
	deleteWindows
} -body {
    # There are no sashes until you have 2 panes
    panedwindow .p
    .p add [frame .p.f]
    list [catch {.p sash coord -1} msg] $msg \
	    [catch {.p sash coord  0} msg] $msg \
	    [catch {.p sash coord  1} msg] $msg 
} -cleanup {
	deleteWindows
} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-6.10 {sash coord subcommand, errors} -setup {
	deleteWindows
} -body {
    # There are no sashes until you have 2 panes
    panedwindow .p
    .p add [frame .p.f] [frame .p.f2]
    list [catch {.p sash coord -1} msg] $msg \
	    [catch {.p sash coord  0} msg] \
	    [catch {.p sash coord  1} msg] $msg \
	    [catch {.p sash coord  2} msg] $msg 
} -cleanup {
	deleteWindows
} -result [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"]


test panedwindow-7.1 {sash mark subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash mark
} -cleanup {
	deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash mark index ?x y?"}
test panedwindow-7.2 {sash mark subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash mark foo
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-7.3 {sash mark subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash mark 0 foo bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-7.4 {sash mark subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash mark 0 foo bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-7.5 {sash mark subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash mark 0 0 bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-7.6 {sash mark subcommand, mark defaults to 0 0} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash mark 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-7.7 {sash mark subcommand, set mark} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash mark 0 10 10
    .p sash mark 0
} -cleanup {
	deleteWindows
} -result [list 10 10]


test panedwindow-8.1 {sash dragto subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash dragto
} -cleanup {
	deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash dragto index x y"}
test panedwindow-8.2 {sash dragto subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash dragto foo bar baz
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-8.3 {sash dragto subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash dragto 0 foo bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-8.4 {sash dragto subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash dragto 0 foo bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-8.5 {sash dragto subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash dragto 0 0 bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
    

test panedwindow-9.1 {sash mark/sash dragto interaction} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
    .p add [frame .f -width 20 -height 20] [button .c -text foobar]
    .p sash mark 0 10 10
    .p sash dragto 0 20 10
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 30 0]
test panedwindow-9.2 {sash mark/sash dragto interaction} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical \
            -showhandle false
    .p add [frame .p.f -width 20 -height 20] [button .p.c -text foobar]
    .p sash mark 0 10 10
    .p sash dragto 0 10 20
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 30]
test panedwindow-9.3 {sash mark/sash dragto, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
    .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
    .p sash mark 0 20 10
    .p sash dragto 0 10 10
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 15 0]


test panedwindow-10.1 {sash place subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash place
} -cleanup {
	deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash place index x y"}
test panedwindow-10.2 {sash place subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash place foo bar baz
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-10.3 {sash place subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p sash place 0 foo bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-10.4 {sash place subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash place 0 foo bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-10.5 {sash place subcommand, errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p sash place 0 0 bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-10.6 {sash place subcommand, moves sash} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 20] [button .c]
    .p sash place 0 10 0
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 10 0]
test panedwindow-10.7 {sash place subcommand, moves sash} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical
    .p add [frame .f -width 20 -height 20] [button .c]
    .p sash place 0 0 10
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 10]
test panedwindow-10.8 {sash place subcommand, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
    .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
    .p sash place 0 10 0
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 15 0]
test panedwindow-10.9 {sash place subcommand, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [frame .f -width 20 -height 20 -bg pink]
    .p sash place 0 2 0
} -cleanup {
	deleteWindows
} -returnCodes error -result {invalid sash index}


test panedwindow-11.1 {moving sash changes size of pane to left} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
    .p add [frame .f -width 20 -height 20] [button .c -text foobar] -sticky nsew
    .p sash place 0 30 0
    pack .p
    update
    winfo width .f
} -result 30
test panedwindow-11.2 {moving sash changes size of pane to right} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
    pack .p
    update
    set result [winfo width .f2]
    .p sash place 0 30 0
    update
    lappend result [winfo width .f2]
} -cleanup {
	deleteWindows
} -result {20 10}
test panedwindow-11.3 {moving sash does not change reqsize of panedwindow} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
    .p sash place 0 30 0
    winfo reqwidth .p
} -result 44
test panedwindow-11.4 {moving sash changes size of pane above} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    .p add [frame .f -width 20 -height 10] [button .c -text foobar] -sticky nsew
    .p sash place 0 0 20
    pack .p
    update
    set result [winfo height .f]
    set result
} -result 20
test panedwindow-11.5 {moving sash changes size of pane below} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
    pack .p
    update
    set result [winfo height .f2]
    .p sash place 0 0 15
    update
    lappend result [winfo height .f2]
    set result
} -cleanup {
	deleteWindows
} -result {10 5}
test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
    set result [winfo reqheight .p]
    .p sash place 0 0 20
    lappend result [winfo reqheight .p]
    set result
} -cleanup {
	deleteWindows
} -result [list 24 24]
test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
    set result [winfo reqheight .f]
    .p sash place 0 0 20
    lappend result [winfo reqheight .f]
} -cleanup {
	deleteWindows
} -result [list 10 10]
test panedwindow-11.8 {moving sash restricted to minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
    .p sash place 0 10 0
    pack .p
    update
    winfo width .f
} -result 15
test panedwindow-11.9 {moving sash restricted to minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    .p add [frame .f -width 20 -height 30] [button .c] -minsize 10
    .p sash place 0 0 5
    pack .p
    update
    winfo height .f
} -result 10
test panedwindow-11.10 {moving sash in unmapped window restricted to reqsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20]
    set result [list [.p sash coord 0]]
    .p sash place 0 100 0
    lappend result [.p sash coord 0]
} -cleanup {
	deleteWindows
} -result [list {20 0} {40 0}]
test panedwindow-11.11 {moving sash right pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
	    [frame .f3 -width 20 -height 30]
    .p sash place 0 80 0
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result {{60 0} {64 0}}
test panedwindow-11.12 {moving sash left pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
	    [frame .f3 -width 20 -height 30]
    .p sash place 1 0 0
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result {{0 0} {4 0}}
test panedwindow-11.13 {move sash in mapped window restricted to visible win} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
	    [frame .f3 -width 20 -height 30]
    place .p -width 50
    update
    .p sash place 1 100 0
    update
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result {46 0}
test panedwindow-11.14 {move sash in mapped window restricted to visible win} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
	    [frame .f3 -width 20 -height 30]
    place .p -width 100
    update
    .p sash place 1 200 0
    update
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result {96 0}
test panedwindow-11.15 {moving sash into "virtual" space on last pane increases reqsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
	    [frame .f3 -width 20 -height 30]
    place .p -width 100
    set result [winfo reqwidth .p]
    update
    .p sash place 1 200 0
    update
    lappend result [winfo reqwidth .p]
} -cleanup {
	deleteWindows
} -result {68 100}
    

test panedwindow-12.1 {horizontal panedwindow lays out widgets properly} -setup {
	deleteWindows
    set result {}
} -body {
    panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2
    foreach win {.p.f .p.f2 .p.f3} {.p add [frame $win -width 20 -height 10]}
    pack .p
    update
    foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
    return $result
} -cleanup {
	deleteWindows
} -result [list 2 2 28 2 54 2]
test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup {
	deleteWindows
    set result {}
} -body {
    panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2 \
            -orient vertical
    foreach win {.p.f .p.f2 .p.f3} {.p add [frame $win -width 20 -height 10]}
    pack .p
    update
    foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
    return $result
} -cleanup {
	deleteWindows
} -result [list 2 2 2 18 2 34]
test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach {win color} {.p.f blue .p.f2 green} {
	    .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
            -sticky ""
    }
    pack .p
    update
    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
    .p paneconfigure .p.f -padx 0 -pady 0
    update
    lappend result [winfo reqwidth .p] [winfo reqheight .p]
    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
    return $result
} -cleanup {
	deleteWindows
} -result [list 80 30 10 5 50 5 60 30 0 5 30 5]
test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
            -orient vertical
    foreach win {.p.f .p.f2} {
	.p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky ""
    }
    pack .p
    update
    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
    .p paneconfigure .p.f -padx 0 -pady 0
    update
    lappend result [winfo reqwidth .p] [winfo reqheight .p]
    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
    return $result
} -cleanup {
	deleteWindows
} -result [list 40 60 10 5 10 35 40 50 10 0 10 25]
test panedwindow-12.5 {panedwindow respects reqsize of panes when possible} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -width 20 -height 20] -sticky ""
    place .p -width 40
    update
    set result [list [winfo width .p.f]]
    .p.f configure -width 30
    update
    lappend result [winfo width .p.f]
} -cleanup {
	deleteWindows
} -result [list 20 30]
test panedwindow-12.6 {panedwindow takes explicit widget width over reqwidth} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -width 20 -height 20] -width 20 -sticky ""
    place .p -width 40
    update
    set result [list [winfo width .p.f]]
    .p.f configure -width 30
    update
    lappend result [winfo width .p.f]
} -cleanup {
	deleteWindows
} -result [list 20 20]
test panedwindow-12.7 {horizontal panedwindow reqheight is max slave height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20]
    set result [winfo reqheight .p]
    .p.f config -height 40
    lappend result [winfo reqheight .p]
} -cleanup {
	deleteWindows
} -result {20 40}
test panedwindow-12.8 {horizontal panedwindow reqheight is max slave height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
    .p paneconfigure .p.f -height 15
    set result [winfo reqheight .p]
    .p.f config -height 40
    lappend result [winfo reqheight .p]
} -cleanup {
	deleteWindows
} -result {20 20}
test panedwindow-12.9 {panedwindow pane width overrides widget width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
    .p sash place 0 10 0
    pack .p
    update
    set result [winfo width .p.f]
    .p paneconfigure .p.f -width 30
    lappend result [winfo width .p.f]
} -cleanup {
	deleteWindows
} -result [list 10 10]
test panedwindow-12.10 {panedwindow respects reqsize of panes when possible} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -width 20 -height 20] -sticky ""
    place .p -height 40
    update
    set result [list [winfo height .p.f]]
    .p.f configure -height 30
    update
    lappend result [winfo height .p.f]
} -cleanup {
	deleteWindows
} -result [list 20 30]
test panedwindow-12.11 {panedwindow takes explicit height over reqheight} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -width 20 -height 20] -height 20 -sticky ""
    place .p -height 40
    update
    set result [list [winfo height .p.f]]
    .p.f configure -height 30
    update
    lappend result [winfo height .p.f]
} -cleanup {
	deleteWindows
} -result [list 20 20]
test panedwindow-12.12 {vertical panedwindow reqwidth is max slave width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20]
    set result [winfo reqwidth .p]
    .p.f config -width 40
    lappend result [winfo reqwidth .p]
} -cleanup {
	deleteWindows
} -result {20 40}
test panedwindow-12.13 {vertical panedwindow reqwidth is max slave width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
    .p paneconfigure .p.f -width 15
    set result [winfo reqwidth .p]
    .p.f config -width 40
    lappend result [winfo reqwidth .p]
} -cleanup {
	deleteWindows
} -result {20 20}
test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
            -orient vertical
    foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
    .p sash place 0 0 10
    pack .p
    update
    set result [winfo height .p.f]
    .p paneconfigure .p.f -height 30
    lappend result [winfo height .p.f]
} -cleanup {
	deleteWindows
} -result [list 10 10]


test panedwindow-13.1 {PanestructureProc, widget yields managements} -setup {
	deleteWindows
} -body {
    # Check that the panedwindow correctly yields geometry management of
    # a slave when the slave is destroyed.

    # This test should not cause a core dump, and it should not cause
    # a memory leak.
    panedwindow .p
    .p add [button .b]
    destroy .p
    pack .b
    destroy .b
    set result ""
} -result {}
test panedwindow-13.2 {PanedWindowLostSlaveProc, widget yields management} -setup {
	deleteWindows
} -body {
    # Check that the paned window correctly yields geometry management of
    # a slave when some other geometry manager steals the slave from us.
    
    # This test should not cause a core dump, and it should not cause a
    # memory leak.
    panedwindow .p
    .p add [button .b]
    pack .p
    update
    pack .b
    update
    set result [.p panes]
    destroy .p .b
    set result
} -result {}


test panedwindow-14.1 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky n
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {n}
test panedwindow-14.2 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky s
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {s}
test panedwindow-14.3 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky e
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {e}
test panedwindow-14.4 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky w
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {w}
test panedwindow-14.5 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky sn
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {ns}
test panedwindow-14.6 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky ns
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {ns}
test panedwindow-14.7 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky en
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {ne}
test panedwindow-14.8 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky ne
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {ne}
test panedwindow-14.9 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky wn
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {nw}
test panedwindow-14.10 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky nw
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {nw}
test panedwindow-14.11 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky esn
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {nes}
test panedwindow-14.12 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky nse
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {nes}
test panedwindow-14.13 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky nsw
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {nsw}
test panedwindow-14.14 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky nsew
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {nesw}
test panedwindow-14.15 {panedwindow sticky settings} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false
    .p add [button .b]
    .p paneconfigure .b -sticky ""
    .p panecget .b -sticky
} -cleanup {
    deleteWindows
} -result {}


test panedwindow-15.1 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky {}
    place .p -width 40 -height 40
    update
    list {} [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {{} 10 10 20 20}
test panedwindow-15.2 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky n
    place .p -width 40 -height 40
    update
    list n [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {n 10 0 20 20}
test panedwindow-15.3 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky s
    place .p -width 40 -height 40
    update
    list s [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {s 10 20 20 20}
test panedwindow-15.4 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky e
    place .p -width 40 -height 40
    update
    list e [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {e 20 10 20 20}
test panedwindow-15.5 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky w
    place .p -width 40 -height 40
    update
    list w [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {w 0 10 20 20}
test panedwindow-15.6 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ns
    place .p -width 40 -height 40
    update
    list ns [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {ns 10 0 20 40}
test panedwindow-15.7 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ew
    place .p -width 40 -height 40
    update
    list ew [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {ew 0 10 40 20}
test panedwindow-15.8 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nw
    place .p -width 40 -height 40
    update
    list nw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {nw 0 0 20 20}
test panedwindow-15.9 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ne
    place .p -width 40 -height 40
    update
    list ne [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {ne 20 0 20 20}
test panedwindow-15.10 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky se
    place .p -width 40 -height 40
    update
    list se [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {se 20 20 20 20}
test panedwindow-15.11 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sw
    place .p -width 40 -height 40
    update
    list sw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {sw 0 20 20 20}
test panedwindow-15.12 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nse
    place .p -width 40 -height 40
    update
    list nse [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {nse 20 0 20 40}
test panedwindow-15.13 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nsw
    place .p -width 40 -height 40
    update
    list nsw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {nsw 0 0 20 40}
test panedwindow-15.14 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sew
    place .p -width 40 -height 40
    update
    list sew [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {sew 0 20 40 20}
test panedwindow-15.15 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky new
    place .p -width 40 -height 40
    update
    list new [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {new 0 0 40 20}
test panedwindow-15.16 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky news
    place .p -width 40 -height 40
    update
    list news [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {news 0 0 40 40}


test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .p.f -height 20 -width 20 -bg red]
    set result [winfo reqwidth .p]
    .p paneconfigure .p.f -minsize 40
    lappend result [winfo reqwidth .p]
} -cleanup {
	deleteWindows
} -result [list 20 40]


test panedwindow-17.1 {MoveSash, move right} -setup {
	deleteWindows
    set result {}
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqwidth .p]
    
    .p sash place 0 30 0
    
    # Get the reqwidth again, to make sure it hasn't changed
    lappend result [winfo reqwidth .p]

    # Check that the sash moved
    lappend result [.p sash coord 0]
} -cleanup {
	deleteWindows
} -result [list 42 42 {30 0}]
test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 0 100 0
    
    # Get the new sash coord; it should be clipped by the reqwidth of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 40 0]
test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }
    
    # Put the panedwindow up on the display and give it a width < reqwidth
    place .p -x 0 -y 0 -width 32
    update

    .p sash place 0 100 0
    
    # Get the new sash coord; it should be clipped by the visible width of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 30 0]
test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }
    
    # Put the panedwindow up on the display and give it a width > reqwidth
    place .p -x 0 -y 0 -width 102
    update

    .p sash place 0 200 0
    
    # Get the new sash coord; it should be clipped by the visible width of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 100 0]
test panedwindow-17.5 {MoveSash, move right respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 100 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 30 0]
test panedwindow-17.6 {MoveSash, move right respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 100 0
    
    # Get the new sash coord; it should have moved as far as possible.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 40 0]
test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 0 100 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 62 0]
test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 100 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 52 0]
test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize 10 -padx 5
    }

    .p sash place 0 100 0
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 50 0]
test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 0 50 0
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result [list [list 50 0] [list 52 0]]
test panedwindow-17.11 {MoveSash, move left} -setup {
	deleteWindows
} -body {
    set result {}
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqwidth .p]
    
    .p sash place 0 10 0
    
    # Get the reqwidth again, to make sure it hasn't changed
    lappend result [winfo reqwidth .p]

    # Check that the sash moved
    lappend result [.p sash coord 0]
} -cleanup {
	deleteWindows
} -result [list 42 42 {10 0}]
test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 0 -100 0
    
    # Get the new sash coord; it should be clipped by the reqwidth of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-17.13 {MoveSash, move left respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 10 0]
test panedwindow-17.14 {MoveSash, move left respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 22 0]
test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 10 0]
test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize 10 -padx 5
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 42 0]
test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue green} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 1 10 0
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result [list [list 8 0] [list 10 0]]


test panedwindow-18.1 {MoveSash, move down} -setup {
	deleteWindows
} -body {
    set result {}
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqheight .p]
    
    .p sash place 0 0 30
    
    # Get the reqwidth again, to make sure it hasn't changed
    lappend result [winfo reqheight .p]

    # Check that the sash moved
    lappend result [.p sash coord 0]
} -cleanup {
	deleteWindows
} -result [list 42 42 {0 30}]
test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 0 0 100
    
    # Get the new sash coord; it should be clipped by the reqheight of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 40]
test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }
    
    # Put the panedwindow up on the display and give it a height < reqheight
    place .p -x 0 -y 0 -height 32
    update

    .p sash place 0 0 100
    
    # Get the new sash coord; it should be clipped by the visible height of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 30]
test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }
    
    # Put the panedwindow up on the display and give it a width > reqwidth
    place .p -x 0 -y 0 -height 102
    update

    .p sash place 0 0 200
    
    # Get the new sash coord; it should be clipped by the visible width of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 100]
test panedwindow-18.5 {MoveSash, move down respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 100
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 30]
test panedwindow-18.6 {MoveSash, move down respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 100
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 40]
test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 0 0 100
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 62]
test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 100
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 52]
test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize 10 -pady 5
    }

    .p sash place 0 0 100
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 50]
test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 0 0 50
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result [list [list 0 50] [list 0 52]]
test panedwindow-18.11 {MoveSash, move up} -setup {
	deleteWindows
} -body {
    set result {}
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqheight .p]
    
    .p sash place 0 0 10
    
    # Get the reqwidth again, to make sure it hasn't changed
    lappend result [winfo reqheight .p]

    # Check that the sash moved
    lappend result [.p sash coord 0]
} -cleanup {
	deleteWindows
} -result [list 42 42 {0 10}]
test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 0 0 -100
    
    # Get the new sash coord; it should be clipped by the reqwidth of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-18.13 {MoveSash, move up respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 10]
test panedwindow-18.14 {MoveSash, move up respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 22]
test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 10]
test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize 10 -pady 5
    }

    .p sash place 1 0 0
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 42]
test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue green} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 1 0 10
    
    # Get the new sash coord; it should have moved as far as possible, 
    # respecting minsizes.
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result [list [list 0 8] [list 0 10]]


# The following tests check that the panedwindow is correctly computing its
# geometry based on the various configuration options that can affect the
# geometry.

test panedwindow-19.1 {ComputeGeometry, reqheight taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach w {.f1 .f2 .f3} {
	    .p add [frame $w -width 20 -height 20 -bg blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .f3 configure -height 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 20] [list 60 40]]

test panedwindow-19.2 {ComputeGeometry, reqheight taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach w {.f1 .f2 .f3} {
	    .p add [frame $w -width 20 -height 20 -bg blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -height 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 20] [list 60 40]]

test panedwindow-19.3 {ComputeGeometry, reqheight taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach w {.f1 .f2 .f3} {
	    .p add [frame $w -width 20 -height 20 -bg blue] -pady 20
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -height 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 60] [list 60 80]]

test panedwindow-19.4 {ComputeGeometry, reqwidth taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
            -orient vertical
    foreach w {.f1 .f2 .f3} {
	.p add [frame $w -width 20 -height 20 -bg blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .f3 configure -width 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 20 60] [list 40 60]]

test panedwindow-19.5 {ComputeGeometry, reqwidth taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
            -orient vertical
    foreach w {.f1 .f2 .f3} {
	.p add [frame $w -width 20 -height 20 -bg blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -width 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 20 60] [list 40 60]]

test panedwindow-19.6 {ComputeGeometry, reqwidth taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
            -orient vertical
    foreach w {.f1 .f2 .f3} {
	.p add [frame $w -width 20 -height 20 -bg blue] -padx 20
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -width 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 60] [list 80 60]]

test panedwindow-19.7 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.8 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {60 20}

test panedwindow-19.9 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{20 0} {40 0}}

test panedwindow-19.10 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {53 3 20 20} {95 3 20 20}}

test panedwindow-19.11 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.12 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 60}

test panedwindow-19.13 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 20} {0 40}}

test panedwindow-19.14 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 53 20 20} {3 95 20 20}}
test panedwindow-19.15 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.16 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {72 20}

test panedwindow-19.17 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{23 0} {49 0}}

test panedwindow-19.18 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}}

test panedwindow-19.19 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.20 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 72}

test panedwindow-19.21 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 23} {0 49}}

test panedwindow-19.22 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}}
test panedwindow-19.23 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.24 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {66 20}

test panedwindow-19.25 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{20 0} {43 0}}

test panedwindow-19.26 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {56 3 20 20} {101 3 20 20}}

test panedwindow-19.27 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.28 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 66}

test panedwindow-19.29 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 20} {0 43}}

test panedwindow-19.30 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 56 20 20} {3 101 20 20}}
test panedwindow-19.31 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.32 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {72 20}

test panedwindow-19.33 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{21 0} {47 0}}

test panedwindow-19.34 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}}

test panedwindow-19.35 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.36 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 72}

test panedwindow-19.37 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 21} {0 47}}

test panedwindow-19.38 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}}
test panedwindow-19.39 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.40 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {80 20}

test panedwindow-19.41 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{25 0} {55 0}}

test panedwindow-19.42 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {63 3 20 20} {115 3 20 20}}

test panedwindow-19.43 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.44 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 80}

test panedwindow-19.45 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 25} {0 55}}

test panedwindow-19.46 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 63 20 20} {3 115 20 20}}
test panedwindow-19.47 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.48 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {92 20}

test panedwindow-19.49 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{28 0} {64 0}}

test panedwindow-19.50 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}}

test panedwindow-19.51 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.52 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 92}

test panedwindow-19.53 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 28} {0 64}}

test panedwindow-19.54 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}}
test panedwindow-19.55 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.56 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {86 20}

test panedwindow-19.57 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{25 0} {58 0}}

test panedwindow-19.58 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {66 3 20 20} {121 3 20 20}}

test panedwindow-19.59 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.60 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 86}

test panedwindow-19.61 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 25} {0 58}}

test panedwindow-19.62 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 66 20 20} {3 121 20 20}}
test panedwindow-19.63 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.64 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {92 20}

test panedwindow-19.65 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{26 0} {62 0}}

test panedwindow-19.66 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}}

test panedwindow-19.67 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.68 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 92}

test panedwindow-19.69 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 26} {0 62}}

test panedwindow-19.70 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}}
test panedwindow-19.71 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.72 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {64 24}

test panedwindow-19.73 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{22 2} {42 2}}

test panedwindow-19.74 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {55 5 20 20} {97 5 20 20}}

test panedwindow-19.75 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.76 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 64}

test panedwindow-19.77 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 22} {2 42}}

test panedwindow-19.78 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 55 20 20} {5 97 20 20}}
test panedwindow-19.79 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.80 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {76 24}

test panedwindow-19.81 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{25 2} {51 2}}

test panedwindow-19.82 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}}

test panedwindow-19.83 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.84 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 76}

test panedwindow-19.85 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 25} {2 51}}

test panedwindow-19.86 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}}
test panedwindow-19.87 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.88 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {70 24}

test panedwindow-19.89 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{22 2} {45 2}}

test panedwindow-19.90 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {58 5 20 20} {103 5 20 20}}

test panedwindow-19.91 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.92 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 70}

test panedwindow-19.93 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 22} {2 45}}

test panedwindow-19.94 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 58 20 20} {5 103 20 20}}
test panedwindow-19.95 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.96 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {76 24}

test panedwindow-19.97 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{23 2} {49 2}}

test panedwindow-19.98 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}}

test panedwindow-19.99 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.100 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 76}

test panedwindow-19.101 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 23} {2 49}}

test panedwindow-19.102 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}}
test panedwindow-19.103 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.104 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {84 24}

test panedwindow-19.105 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{27 2} {57 2}}

test panedwindow-19.106 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {65 5 20 20} {117 5 20 20}}

test panedwindow-19.107 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.108 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 84}

test panedwindow-19.109 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 27} {2 57}}

test panedwindow-19.110 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 65 20 20} {5 117 20 20}}
test panedwindow-19.111 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.112 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {96 24}

test panedwindow-19.113 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{30 2} {66 2}}

test panedwindow-19.114 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}}

test panedwindow-19.115 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.116 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 96}

test panedwindow-19.117 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 30} {2 66}}

test panedwindow-19.118 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}}
test panedwindow-19.119 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.120 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {90 24}

test panedwindow-19.121 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{27 2} {60 2}}

test panedwindow-19.122 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {68 5 20 20} {123 5 20 20}}

test panedwindow-19.123 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.124 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 90}

test panedwindow-19.125 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 27} {2 60}}

test panedwindow-19.126 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 68 20 20} {5 123 20 20}}
test panedwindow-19.127 {ComputeGeometry, one slave, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.128 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {96 24}

test panedwindow-19.129 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{28 2} {64 2}}

test panedwindow-19.130 {ComputeGeometry/ArrangePanes, slave coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
    }
    return $result
} -cleanup {
    deleteWindows
} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}}

test panedwindow-19.131 {ComputeGeometry, one slave, vertical} -setup {
    deleteWindows
} -body {
    # With just one slave, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.132 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 96}

test panedwindow-19.133 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 28} {2 64}}

test panedwindow-19.134 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}}


test panedwindow-20.1 {destroyed widgets are removed from panedwindow} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [frame .f -width 20 -height 20 -bg blue]
    destroy .f
    .p panes
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-20.2 {destroyed slave causes geometry recomputation} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red]
    destroy .f
    winfo reqwidth .p
} -cleanup {
    deleteWindows
} -result 20
    

test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    place .p -width 100 -x 0 -y 0
    update
    winfo width .f2
} -cleanup {
    deleteWindows
} -result 78
test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    place .p -height 100 -x 0 -y 0
    update
    winfo height .f2
} -cleanup {
    deleteWindows
} -result 78
test panedwindow-21.3 {ArrangePanes, explicit height/width are preferred} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky ""
    .p paneconfigure .f1 -width 10 -height 15
    pack .p
    update
    list [winfo width .f1] [winfo height .f1]
} -cleanup {
	deleteWindows
} -result {10 15}
test panedwindow-21.4 {ArrangePanes, panes clipped by size of pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red]
    .p sash place 0 10 0
    pack .p
    update
    list [winfo width .f1] [winfo height .f1]
} -cleanup {
	deleteWindows
} -result {10 20}
test panedwindow-21.5 {ArrangePanes, panes clipped by size of pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red]
    .p sash place 0 0 10
    pack .p
    update
    list [winfo width .f1] [winfo height .f1]
} -cleanup {
	deleteWindows
} -result {20 10}
test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 20 -height 40 -bg red] -sticky ""
    pack .p
    update
    winfo y .p.f1
} -cleanup {
    deleteWindows
} -result 10
test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 40 -height 40 -bg red] -sticky ""
    pack .p
    update
    winfo x .p.f1
} -cleanup {
    deleteWindows
} -result 10
test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 40 -bg red]
    pack .p
    update
    set result [winfo ismapped .f1]
    .p sash place 0 0 0
    update
    lappend result [winfo ismapped .f1]
} -cleanup {
	deleteWindows
} -result {1 0}
test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 20 -height 40 -bg red]
    pack .p
    update
    set result [winfo ismapped .p.f1]
    .p sash place 0 0 0
    update
    lappend result [winfo ismapped .p.f1]
} -cleanup {
	deleteWindows
} -result {1 0}
test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 -orient vertical
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 20 -height 40 -bg red]
    pack .p
    update
    set result [winfo ismapped .p.f1]
    .p sash place 0 0 0
    update
    lappend result [winfo ismapped .p.f1]
} -cleanup {
	deleteWindows
} -result {1 0}
test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    place .p -width 40 -x 0 -y 0
    update
    winfo width .f2
} -cleanup {
    deleteWindows
} -result 18
test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    place .p -height 40 -x 0 -y 0
    update
    winfo height .f2
} -cleanup {
    deleteWindows
} -result 18
test panedwindow-21.13 {ArrangePanes, panedwindow resizes} -setup {
	deleteWindows
} -body {
	panedwindow .p -width 200 -borderwidth 0
	frame .f1 -height 50 -bg blue
	set result [list]
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
	.p add .f1
	pack .p
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {200 1 200 50}
test panedwindow-21.14 {ArrangePanes, panedwindow resizes} -setup {
	deleteWindows
} -body {
	panedwindow .p -height 200 -borderwidth 0 -orient vertical
	frame .f1 -width 50 -bg blue
	set result [list]
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
	.p add .f1
	pack .p
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {1 200 50 200}
test panedwindow-21.15 {ArrangePanes, last pane grows} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 50
	.p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
		[frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
	.p sash place 1 250 0
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
	.p configure -width 300
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
} -cleanup {
    deleteWindows
} -result {50 150 1 1 211 50 150 1 89 300}


test panedwindow-22.1 {PanedWindowReqProc, react to slave geometry changes} -setup {
	deleteWindows
} -body {
    # Basically just want to make sure that the PanedWindowReqProc is called
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 40 -bg red]
    set result [winfo reqheight .p]
    .f1 configure -height 80
    lappend result [winfo reqheight .p]
} -cleanup {
	deleteWindows
} -result {40 80}
test panedwindow-22.2 {PanedWindowReqProc, react to slave geometry changes} -setup {
	deleteWindows
} -body {
    panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 10] [frame .f2 -width 10]
    set result [winfo reqwidth .p]
    .f1 configure -width 20
    lappend result [winfo reqwidth .p]
    destroy .p .f1 .f2
    expr {[lindex $result 1] - [lindex $result 0]}
} -cleanup {
	deleteWindows
} -result {10}


test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add .p
} -cleanup {
	deleteWindows
} -returnCodes error -result {can't add .p to itself}
test panedwindow-23.2 {ConfigurePanes, bad window throws error} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add .b
} -cleanup {
	deleteWindows
} -returnCodes error -result {bad window path name ".b"}
test panedwindow-23.3 {ConfigurePanes, bad window aborts processing} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .b
    catch {.p add .b .a}
    .p panes
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-23.4 {ConfigurePanes, bad option aborts processing} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .b
    catch {.p add .b -sticky foobar}
    .p panes
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-23.5 {ConfigurePanes, after win isn't managed by panedwin} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .b
    button .c
    .p add .b -after .c
} -cleanup {
	deleteWindows
} -returnCodes error -result {window ".c" is not managed by .p}
test panedwindow-23.6 {ConfigurePanes, before win isn't managed by panedwin} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .b
    button .c
    .p add .b -before .c
} -cleanup {
	deleteWindows
} -returnCodes error -result {window ".c" is not managed by .p}
test panedwindow-23.7 {ConfigurePanes, -after {} is a no-op} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p paneconfigure .b -after {}
    .p panes
} -cleanup {
	deleteWindows
} -result {.b .c}
test panedwindow-23.8 {ConfigurePanes, -before {} is a no-op} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p paneconfigure .b -before {}
    .p panes
} -cleanup {
	deleteWindows
} -result {.b .c}
test panedwindow-23.9 {ConfigurePanes, new panes are added} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c]
    .p panes
} -cleanup {
	deleteWindows
} -result {.b .c}
test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] [button .c] -sticky ne -height 5 -width 5 -minsize 10
    set result {}
    foreach w {.b .c} {
        set val {}
        foreach option {-sticky -height -width -minsize} {
            lappend val $option [.p panecget $w $option]
        }
        lappend result $w $val
    }
    return $result
} -cleanup {
	deleteWindows
} -result {.b {-sticky ne -height 5 -width 5 -minsize 10} .c {-sticky ne -height 5 -width 5 -minsize 10}}

test panedwindow-23.11 {ConfigurePanes, existing panes are reconfigured} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b] -sticky nw -height 10
    .p add .b [button .c] -sticky se -height 2
    list [.p panes] [.p panecget .b -sticky] [.p panecget .b -height] \
	    [.p panecget .c -sticky] [.p panecget .c -height]
} -cleanup {
	deleteWindows
} -result [list {.b .c} es 2 es 2]
test panedwindow-23.12 {ConfigurePanes, widgets added to end by default} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [button .b]
    .p add [button .c]
    .p add [button .d]
    .p panes
} -cleanup {
	deleteWindows
} -result {.b .c .d}
test panedwindow-23.13 {ConfigurePanes, -after, single addition} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c

    .p add .a .b
    .p add .c -after .a
    .p panes
} -cleanup {
	deleteWindows
} -result {.a .c .b}
test panedwindow-23.14 {ConfigurePanes, -after, multiple additions} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b
    .p add .c .d -after .a
    .p panes
} -cleanup {
	deleteWindows
} -result {.a .c .d .b}
test panedwindow-23.15 {ConfigurePanes, -after, relocates existing widget} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b .c .d
    .p add .d -after .a
    .p panes
} -cleanup {
	deleteWindows
} -result {.a .d .b .c}
test panedwindow-23.16 {ConfigurePanes, -after, relocates existing widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b .c .d
    .p add .b .d -after .a
    .p panes
} -cleanup {
	deleteWindows
} -result {.a .b .d .c}
test panedwindow-23.17 {ConfigurePanes, -after, relocates existing widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b .c .d
    .p add .d .a -after .b
    .p panes
} -cleanup {
	deleteWindows
} -result {.b .d .a .c}
test panedwindow-23.18 {ConfigurePanes, -after, relocates existing widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b .c .d
    .p add .d .a -after .a
    .p panes
} -cleanup {
	deleteWindows
} -result {.d .a .b .c}
test panedwindow-23.19 {ConfigurePanes, -after, after last window} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b .c
    .p add .d -after .c
    .p panes
} -cleanup {
	deleteWindows
} -result {.a .b .c .d}
test panedwindow-23.20 {ConfigurePanes, -before, before first window} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b .c
    .p add .d -before .a
    .p panes
} -cleanup {
	deleteWindows
} -result {.d .a .b .c}
test panedwindow-23.21 {ConfigurePanes, -before, relocate existing windows} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .a
    button .b
    button .c
    button .d

    .p add .a .b .c
    .p add .d .b -before .a
    .p panes
} -cleanup {
	deleteWindows
} -result {.d .b .a .c}
test panedwindow-23.22 {ConfigurePanes, slave specified multiple times} -setup {
	deleteWindows
} -body {
    # This test should not cause a core dump

    panedwindow .p
    button .a
    button .b
    button .c

    .p add .a .a .b .c
    .p panes
} -cleanup {
	deleteWindows
} -result {.a .b .c}
test panedwindow-23.23 {ConfigurePanes, slave specified multiple times} -setup {
	deleteWindows
} -body {
    # This test should not cause a core dump

    panedwindow .p
    button .a
    button .b
    button .c

    .p add .a .a .b .c
    .p add .a .b .a -after .c
    .p panes
} -cleanup {
	deleteWindows
} -result {.c .a .b}
test panedwindow-23.24 {ConfigurePanes, panedwindow cannot manage toplevels} -setup {
	deleteWindows
} -body {
    panedwindow .p
    toplevel .t
    .p add .t
} -cleanup {
	deleteWindows
} -returnCodes error -result {can't add toplevel .t to .p}
test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup {
	deleteWindows
} -body {
    panedwindow .p
    frame .f
    button .f.b
   .p add .f.b
} -cleanup {
	deleteWindows
} -returnCodes error -result {can't add .f.b to .p}
test panedwindow-23.26 {ConfigurePanes, restrict possible panes} -setup {
	deleteWindows
} -body {
    frame .f
    panedwindow .f.p
    button .b
    .f.p add .b
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-23.27 {ConfigurePanes, restrict possible panes} -setup {
	deleteWindows
} -body {
    panedwindow .p
    button .p.b
    .p add .p.b
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-23.28 {ConfigurePanes, restrict possible panes} -setup {
	deleteWindows
} -body {
    frame .f
    frame .f.f
    frame .f.f.f
    panedwindow .f.f.f.p
    button .b
    .f.f.f.p add .b
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-23.29 {ConfigurePanes, -hide works} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false
	frame .f1 -width 40 -height 100 -bg red
	frame .f2 -width 40 -height 100 -bg white
	frame .f3 -width 40 -height 100 -bg blue
	frame .f4 -width 40 -height 100 -bg green
	.p add .f1 .f2 .f3 .f4
	pack .p
	update
	set result [list]
	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
		[winfo ismapped .f3] [winfo ismapped .f4]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
		[winfo ismapped .f3] [winfo ismapped .f4]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
} -cleanup {
    deleteWindows
} -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
test panedwindow-23.30 {ConfigurePanes, -hide works} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -width 130 -height 100
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	.p add .f1 .f2 .f3 .f4
	pack .p
	update
	set result [list]
	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
		[winfo ismapped .f3] [winfo ismapped .f4]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
		[winfo ismapped .f3] [winfo ismapped .f4]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
} -cleanup {
    deleteWindows
} -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130}
test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0
	frame .f1 -width 50 -bg red
	frame .f2 -width 50 -bg green
	frame .f3 -width 50 -bg blue
	.p add .f1 .f2 .f3
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
	.p paneconfigure .f2 -hide 1
	update
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
} -cleanup {
    deleteWindows
} -result {50 50 94 50 50 147}
test panedwindow-23.32 {ConfigurePanes, -hide works, last pane stretches} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -width 200 -height 200 \
		-borderwidth 0 -orient vertical
	frame .f1 -height 50 -bg red
	frame .f2 -height 50 -bg green
	frame .f3 -height 50 -bg blue
	.p add .f1 .f2 .f3
	pack .p
	update
	set result [list]
	lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
} -cleanup {
    deleteWindows
} -result {50 50 94 50 50 147}

test panedwindow-23.33 {ConfigurePanes, -stretch first} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	.p add .f1 .f2 .f3 .f4 -stretch first
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
} -cleanup {
    deleteWindows
} -result {51 40 40 40 94 40 40 40}
test panedwindow-23.34 {ConfigurePanes, -stretch middle} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	.p add .f1 .f2 .f3 .f4 -stretch middle
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
} -cleanup {
    deleteWindows
} -result {40 45 46 40 40 45 94 40}
test panedwindow-23.35 {ConfigurePanes, -stretch always} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	.p add .f1 .f2 .f3 .f4 -stretch always
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
} -cleanup {
    deleteWindows
} -result {42 43 43 43 58 43 58 58}
test panedwindow-23.36 {ConfigurePanes, -stretch never} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	.p add .f1 .f2 .f3 .f4 -stretch never
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
} -cleanup {
    deleteWindows
} -result {40 40 40 40 40 40 40 40}


test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup {
	deleteWindows
} -body {
    # Bug 928413
    set result {}
    panedwindow .pw
    label .pw.l1 -text Label1
    label .pw.l2 -text Label2
    label .pw.l3 -text Label3
    .pw add .pw.l1
    .pw add .pw.l3
    .pw add .pw.l2 -before .pw.l3
    lappend result [.pw panecget .pw.l2 -before]
    destroy .pw.l3
    lappend result [.pw panecget .pw.l2 -before]
    .pw paneconfigure .pw.l2 -before .pw.l1
    lappend result [.pw panecget .pw.l2 -before]
} -cleanup {
	deleteWindows
} -result {.pw.l3 {} .pw.l1}


test panedwindow-25.1 {DestroyPanedWindow} -setup {
	deleteWindows
} -body {
    # This test should not result in any memory leaks.
    panedwindow .p
    foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .q .r .s .t} {
	    .p add [button $w]
    }
    foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .p .q .r .s .t} {
	    destroy $w
    }
    set result {}
} -result {}


test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 0 0
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.2 {PanedWindowIdentifyCoords, padding is included} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 20 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.3 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 22 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.4 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 24 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.5 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 26 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.6 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 26 -1
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.7 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 26 100
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.8 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 22 4
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.9 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 22 5
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.10 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 20 5
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.11 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 20 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.12 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20] \
	    [frame .f3 -bg green -width 20 -height 20]
    .p identify 48 0
} -cleanup {
	deleteWindows
} -result {1 sash}
test panedwindow-26.13 {identify subcommand errors} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4
    .p identify
} -cleanup {
	deleteWindows
} -returnCodes error -result {wrong # args: should be ".p identify x y"}
test panedwindow-26.14 {identify subcommand errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p identify foo bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-26.15 {identify subcommand errors} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p identify 0 bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-26.16 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 0 0
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.17 {PanedWindowIdentifyCoords, padding is included} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 0 20
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.18 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 0 22
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.19 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 0 24
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.20 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 0 26
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.21 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify -1 26
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.22 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 100 26
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.23 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 4 22
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.24 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 5 22
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.25 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 5 20
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.26 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p identify 0 20
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.27 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20] \
	    [frame .f3 -bg green -width 20 -height 20]
    .p identify 0 48
} -cleanup {
	deleteWindows
} -result {1 sash}


test panedwindow-27.1 {destroy the window cleanly on error [Bug #616589]} -setup {
	deleteWindows
} -body {
    panedwindow .p -bogusopt bogus
} -cleanup {
	deleteWindows
} -returnCodes error -result {unknown option "-bogusopt"}
test panedwindow-27.2 {destroy the window cleanly on rename [Bug #616589]} -setup {
	deleteWindows
} -body {
    destroy .p
    panedwindow .p
    rename .p {}
    winfo exists .p
} -cleanup {
	deleteWindows
} -result {0}


test panedwindow-28.1 {resizing width} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 5
    frame .f1 -width 100 -height 50 -bg blue
    frame .f2 -width 100 -height 50 -bg red

    .p add .f1 -sticky news
    .p add .f2 -sticky news
    pack .p -side top -fill both -expand 1
    wm geometry . ""
    update
    # Note the width
    set a [winfo width .f2]
    # Increase the size by 10
    regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
    wm geometry . [expr {$w + 10}]x$h
    update
    set b "$a [winfo width .f2]"
} -cleanup {
    deleteWindows
} -result {100 110}

test panedwindow-28.2 {resizing height} -setup {
	deleteWindows
} -body {
    panedwindow .p -orient vertical -bd 5
    frame .f1 -width 50 -height 100 -bg blue
    frame .f2 -width 50 -height 100 -bg red

    .p add .f1 -sticky news
    .p add .f2 -sticky news
    pack .p -side top -fill both -expand 1
    wm geometry . ""
    update
    # Note the height
    set a [winfo height .f2]
    # Increase the size by 10
    regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
    wm geometry . ${w}x[expr {$h + 10}]
    update
    set b "$a [winfo height .f2]"
} -cleanup {
    deleteWindows
} -result {100 110}


test panedwindow-29.1 {display on depths other than the default one} -constraints {
    pseudocolor8 haveTruecolor24
} -setup {
	deleteWindows
} -body {
	toplevel .t -visual {truecolor 24}
	pack [panedwindow .t.p]
	.t.p add [frame .t.p.f1] [frame .t.p.f2]
	update
	# If we got here, we didn't crash and that's good
} -cleanup {
    deleteWindows
} -result {}
test panedwindow-29.2 {display on depths other than the default one} -constraints {
    pseudocolor8 haveTruecolor24
} -setup {
    deleteWindows
} -body {
	toplevel .t -visual {pseudocolor 8}
	pack [frame .t.f -visual {truecolor 24}]
	pack [panedwindow .t.f.p]
	.t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5]
	update
	.t.f.p proxy place 1 1
	update
	.t.f.p proxy forget
	update
	# If we got here, we didn't crash and that's good
} -cleanup {
    deleteWindows
} -result {}


# cleanup
cleanupTests
return


@


1.22
log
@merge stable branch onto HEAD
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.20.2.1 2007/11/01 16:37:24 dgp Exp $
d11 1
a11 1
package require tcltest 2.1
d14 1
d16 2
a17 1
set i 1
d19 1
a19 48
foreach {testName testData} {
    panedwindow-1.1 {-background
	"#ff0000" "#ff0000" non-existent {unknown color name "non-existent"}}
    panedwindow-1.2 {-bd
	4 4 badValue {bad screen distance "badValue"}}
    panedwindow-1.3 {-bg
	"#ff0000" "#ff0000" non-existent {unknown color name "non-existent"}}
    panedwindow-1.4 {-borderwidth
	1.3 1 badValue {bad screen distance "badValue"}}
    panedwindow-1.5 {-cursor
	arrow arrow badValue {bad cursor spec "badValue"}}
    panedwindow-1.6 {-handlesize
	20 20 badValue {bad screen distance "badValue"}}
    panedwindow-1.7 {-height
	20 20 badValue {bad screen distance "badValue"}}
    panedwindow-1.8 {-opaqueresize
	true 1 foo {expected boolean value but got "foo"}}
    panedwindow-1.9 {-orient
	horizontal horizontal
	badValue {bad orient "badValue": must be horizontal or vertical}}
    panedwindow-1.10 {-relief
	groove groove
	1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
    panedwindow-1.11 {-sashcursor
	arrow arrow badValue {bad cursor spec "badValue"}}
    panedwindow-1.12 {-sashpad
	1.3 1 badValue {bad screen distance "badValue"}}
    panedwindow-1.13 {-sashrelief
	groove groove
	1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
    panedwindow-1.14 {-sashwidth
	10 10 badValue {bad screen distance "badValue"}}
    panedwindow-1.15 {-showhandle
	true 1 foo {expected boolean value but got "foo"}}
    panedwindow-1.16 {-width
	402 402 badValue {bad screen distance "badValue"}}
} {
    lassign $testData optionName goodIn goodOut badIn badOut
    test ${testName}(good) "configuration options: $optionName" {
	.p configure $optionName $goodIn
	list [lindex [.p configure $optionName] 4] [.p cget $optionName]
    } [list $goodOut $goodOut]
    test ${testName}(bad) "configuration options: $optionName" -body {
	.p configure $optionName $badIn
    } -returnCodes error -result $badOut
    # Reset to default
    .p configure $optionName [lindex [.p configure $optionName] 3]
}
d22 261
a282 34
foreach {testName testData} {
    panedwindow-1a.1 {-after .c .c badValue {bad window path name "badValue"}}
    panedwindow-1a.2 {-before .c .c badValue {bad window path name "badValue"}}
    panedwindow-1a.3 {-height 10 10 badValue {bad screen distance "badValue"}}
    panedwindow-1a.4 {-hide false 0 foo {expected boolean value but got "foo"}}
    panedwindow-1a.5 {-minsize 10 10 badValue {bad screen distance "badValue"}}
    panedwindow-1a.6 {-padx 1.3 1 badValue {bad screen distance "badValue"}}
    panedwindow-1a.7 {-pady 1.3 1 badValue {bad screen distance "badValue"}}
    panedwindow-1a.8 {-sticky nsew nesw abcd {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w}}
    panedwindow-1a.9 {-stretch alw always foo {bad stretch "foo": must be always, first, last, middle, or never}}
    panedwindow-1a.10 {-width 10 10 badValue {bad screen distance "badValue"}}
} {
    lassign $testData optionName goodIn goodOut badIn badOut
    test ${testName}(good) "configuration options: $optionName" {
	.p paneconfigure .b $optionName $goodIn
	list [lindex [.p paneconfigure .b $optionName] 4] \
	    [.p panecget .b $optionName]
    } [list $goodOut $goodOut]
    test ${testName}(bad) "configuration options: $optionName" -body {
	.p paneconfigure .b $optionName $badIn
    } -returnCodes error -result $badOut
    # Reset to default
    .p paneconfig .b $optionName [lindex [.p paneconfig .b $optionName] 3]
}
destroy .p .b .c

test panedwindow-2.1 {panedwindow widget command} {
    panedwindow .p
    set result [list [catch {.p foo} msg] $msg]
    destroy .p
    set result
} {1 {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash}}

test panedwindow-3.1 {panedwindow panes subcommand} {
d289 16
a304 11
    destroy .p .b .c
    set result
} [list [list .b .c] [list .c]]

test panedwindow-4.1 {forget subcommand} {
    panedwindow .p
    set result [list [catch {.p forget} msg] $msg]
    destroy .p
    set result
} [list 1 "wrong # args: should be \".p forget widget ?widget ...?\""]
test panedwindow-4.2 {forget subcommand, forget one from start} {
d311 6
a316 4
    destroy .p .b .c
    set result
} [list {.b .c} .c]
test panedwindow-4.3 {forget subcommand, forget one from end} {
d325 6
a330 4
    destroy .p .b .c .d
    set result
} [list {.b .c .d} {.b .c}]
test panedwindow-4.4 {forget subcommand, forget multiple} {
d339 6
a344 4
    destroy .p .b .c .d
    set result
} [list {.b .c .d} .d]
test panedwindow-4.5 {forget subcommand, panes are unmapped} {
a349 1

a352 1

d354 6
a359 5
    destroy .p .b .c
    
    set result
} [list 1 1 0 1]
test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} {
d365 34
a398 24
    destroy .p .f .g
    set result
} [list 44 20]

test panedwindow-5.1 {sash subcommand} {
    panedwindow .p
    set result [list [catch {.p sash} msg] $msg]
    destroy .p
    set result
} [list 1 "wrong # args: should be \".p sash option ?arg ...?\""]
test panedwindow-5.2 {sash subcommand} {
    panedwindow .p
    set result [list [catch {.p sash foo} msg] $msg]
    destroy .p
    set result
} [list 1 "bad option \"foo\": must be coord, dragto, mark, or place"]

test panedwindow-6.1 {sash coord subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash coord} msg] $msg]
    destroy .p
    set result
} [list 1 "wrong # args: should be \".p sash coord index\""]
test panedwindow-6.2 {sash coord subcommand, errors} {
d400 15
a414 11
    set result [list [catch {.p sash coord 0} msg] $msg]
    destroy .p
    set result
} [list 1 "invalid sash index"]
test panedwindow-6.3 {sash coord subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash coord foo} msg] $msg]
    destroy .p
    set result
} [list 1 "expected integer but got \"foo\""]
test panedwindow-6.4 {sash coord subcommand sashes correctly placed} {
d419 7
a425 5
    set result [.p sash coord 0]
    destroy .p .p.f .p.f2 .p.f3
    set result
} [list 22 0]
test panedwindow-6.5 {sash coord subcommand sashes correctly placed} {
d430 7
a436 5
    set result [.p sash coord 1]
    destroy .p .p.f .p.f2 .p.f3
    set result
} [list 50 0]
test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} {
d442 7
a448 5
    set result [.p sash coord 0]
    destroy .p .p.f .p.f2 .p.f3
    set result
} [list 0 22]
test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} {
d454 17
a470 15
    set result [.p sash coord 1]
    destroy .p .p.f .p.f2 .p.f3
    set result
} [list 0 50]
test panedwindow-6.8 {sash coord subcommand, errors} {
    panedwindow .p
    set result [list \
	    [catch {.p sash coord -1} msg] $msg \
	    [catch {.p sash coord  0} msg] $msg \
	    [catch {.p sash coord  1} msg] $msg \
	    ]
    destroy .p
    set result
} [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-6.9 {sash coord subcommand, errors} {
d474 1
a474 2
    set result [list \
	    [catch {.p sash coord -1} msg] $msg \
d476 7
a482 6
	    [catch {.p sash coord  1} msg] $msg \
	    ]
    destroy .p
    set result
} [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-6.10 {sash coord subcommand, errors} {
d486 1
a486 2
    set result [list \
	    [catch {.p sash coord -1} msg] $msg \
d489 33
a521 25
	    [catch {.p sash coord  2} msg] $msg \
	    ]
    destroy .p
    set result
} [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"]

test panedwindow-8.1 {sash mark subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash mark} msg] $msg]
    destroy .p
    set result
} [list 1 "wrong # args: should be \".p sash mark index ?x y?\""]
test panedwindow-8.2 {sash mark subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash mark foo} msg] $msg]
    destroy .p
    set result
} [list 1 "expected integer but got \"foo\""]
test panedwindow-8.3 {sash mark subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash mark 0 foo bar} msg] $msg]
    destroy .p
    set result
} [list 1 "invalid sash index"]
test panedwindow-8.4 {sash mark subcommand, errors} {
d524 7
a530 5
    set result [list [catch {.p sash mark 0 foo bar} msg] $msg]
    destroy .p .b .c
    set result
} [list 1 "expected integer but got \"foo\""]
test panedwindow-8.5 {sash mark subcommand, errors} {
d533 7
a539 5
    set result [list [catch {.p sash mark 0 0 bar} msg] $msg]
    destroy .p .b .c
    set result
} [list 1 "expected integer but got \"bar\""]
test panedwindow-8.6 {sash mark subcommand, mark defaults to 0 0} {
d542 7
a548 5
    set result [.p sash mark 0]
    destroy .p .b .c
    set result
} [list 0 0]
test panedwindow-8.7 {sash mark subcommand, set mark} {
d552 33
a584 24
    set result [.p sash mark 0]
    destroy .p .b .c
    set result
} [list 10 10]

test panedwindow-9.1 {sash dragto subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash dragto} msg] $msg]
    destroy .p
    set result
} [list 1 "wrong # args: should be \".p sash dragto index x y\""]
test panedwindow-9.2 {sash dragto subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash dragto foo bar baz} msg] $msg]
    destroy .p
    set result
} [list 1 "expected integer but got \"foo\""]
test panedwindow-9.3 {sash dragto subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash dragto 0 foo bar} msg] $msg]
    destroy .p
    set result
} [list 1 "invalid sash index"]
test panedwindow-9.4 {sash dragto subcommand, errors} {
d587 7
a593 5
    set result [list [catch {.p sash dragto 0 foo bar} msg] $msg]
    destroy .p .b .c
    set result
} [list 1 "expected integer but got \"foo\""]
test panedwindow-9.5 {sash dragto subcommand, errors} {
d596 4
a599 4
    set result [list [catch {.p sash dragto 0 0 bar} msg] $msg]
    destroy .p .b .c
    set result
} [list 1 "expected integer but got \"bar\""]
d601 4
a604 1
test panedwindow-10.1 {sash mark/sash dragto interaction} {
d609 7
a615 5
    set result [.p sash coord 0]
    destroy .p .f .c
    set result
} [list 30 0]
test panedwindow-10.2 {sash mark/sash dragto interaction} {
d621 7
a627 5
    set result [.p sash coord 0]
    destroy .p .p.f .p.c
    set result
} [list 0 30]
test panedwindow-10.3 {sash mark/sash dragto, respects minsize}  {
d632 33
a664 23
    set result [.p sash coord 0]
    destroy .p .f .c
    set result
} [list 15 0]

test panedwindow-11.1 {sash place subcommand, errors} {
    panedwindow .p
    set result [list [catch {.p sash place} msg] $msg]
    destroy .p
    set result
} [list 1 "wrong # args: should be \".p sash place index x y\""]
test panedwindow-11.2 {sash place subcommand, errors} {
    destroy .p
    panedwindow .p
    list [catch {.p sash place foo bar baz} msg] $msg
} [list 1 "expected integer but got \"foo\""]
test panedwindow-11.3 {sash place subcommand, errors} {
    destroy .p
    panedwindow .p
    list [catch {.p sash place 0 foo bar} msg] $msg
} [list 1 "invalid sash index"]
test panedwindow-11.4 {sash place subcommand, errors} {
    destroy .p .b .c
d667 7
a673 4
    list [catch {.p sash place 0 foo bar} msg] $msg
} [list 1 "expected integer but got \"foo\""]
test panedwindow-11.5 {sash place subcommand, errors} {
    destroy .p .f .c .b
d676 7
a682 4
    list [catch {.p sash place 0 0 bar} msg] $msg
} [list 1 "expected integer but got \"bar\""]
test panedwindow-11.6 {sash place subcommand, moves sash} {
    destroy .p .f .c .b
d687 6
a692 3
} [list 10 0]
test panedwindow-11.7 {sash place subcommand, moves sash} {
    destroy .p .f .c
d697 6
a702 3
} [list 0 10]
test panedwindow-11.8 {sash place subcommand, respects minsize} {
    destroy .p .f .c
d707 6
a712 3
} [list 15 0]
test panedwindow-11.9 {sash place subcommand, respects minsize} {
    destroy .p .f .c
d715 4
a718 2
    list [catch {.p sash place 0 2 0} msg] $msg
} [list 1 {invalid sash index}]
d720 4
a723 2
test panedwindow-12.1 {moving sash changes size of pane to left} {
    destroy .p .f .c
d730 4
a733 3
} 30
test panedwindow-12.2 {moving sash changes size of pane to right} {
    destroy .p .f .f2
d742 6
a747 3
} {20 10}
test panedwindow-12.3 {moving sash does not change reqsize of panedwindow} {
    destroy .p .f .f2
d752 4
a755 3
} 44
test panedwindow-12.4 {moving sash changes size of pane above} {
    destroy .p .f .c
a762 1
    destroy .p .f .c
d764 4
a767 3
} 20
test panedwindow-12.5 {moving sash changes size of pane below} {
    destroy .p .f .f2
a776 1
    destroy .p .f .f2
d778 6
a783 2
} {10 5}
test panedwindow-12.6 {moving sash does not change reqsize of panedwindow} {
a789 1
    destroy .p .f .f2
d791 6
a796 3
} [list 24 24]
test panedwindow-12.7 {moving sash does not alter reqsize of widget} {
    destroy .p .f .f2
d803 6
a808 5
    destroy .p .f .f2
    set result
} [list 10 10]
test panedwindow-12.8 {moving sash restricted to minsize} {
    destroy .p .f .c
d814 5
a818 6
    set result [winfo width .f]
    destroy .p .f .c
    set result
} 15
test panedwindow-12.10 {moving sash restricted to minsize} {
    destroy .p .f .c
d825 5
a829 5
    set result [winfo height .f]
    destroy .p .f .c
    set result
} 10
test panedwindow-12.12 {moving sash in unmapped window restricted to reqsize} {
d835 6
a840 4
    destroy .p .f .f2
    set result
} [list {20 0} {40 0}]
test panedwindow-12.13 {moving sash right pushes other sashes} {
d845 7
a851 5
    set result [list [.p sash coord 0] [.p sash coord 1]]
    destroy .p .f .f2 .f3
    set result
} {{60 0} {64 0}}
test panedwindow-12.14 {moving sash left pushes other sashes} {
d856 7
a862 5
    set result [list [.p sash coord 0] [.p sash coord 1]]
    destroy .p .f .f2 .f3
    set result
} {{0 0} {4 0}}
test panedwindow-12.15 {move sash in mapped window restricted to visible win} {
d870 7
a876 5
    set result [.p sash coord 1]
    destroy .p .f .f2 .f3
    set result
} {46 0}
test panedwindow-12.16 {move sash in mapped window restricted to visible win} {
d884 7
a890 6
    set result [.p sash coord 1]
    destroy .p .f .f2 .f3
    set result
} {96 0}
test panedwindow-12.17 {moving sash into "virtual" space on \
	last pane increases reqsize} {
d900 3
a902 3
    destroy .p .f .f2 .f3
    set result
} {68 100}
d904 5
a908 1
test panedwindow-13.1 {horizontal panedwindow lays out widgets properly} {
d913 7
d921 1
a921 5
    foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
    destroy .p .p.f .p.f2 .p.f3
    set result
} [list 2 2 28 2 54 2]
test panedwindow-13.2 {vertical panedwindow lays out widgets properly} {
a926 1
    set result {}
d928 7
a934 4
    destroy .p .p.f .p.f2 .p.f3
    set result
} [list 2 2 2 18 2 34]
test panedwindow-13.3 {horizontal panedwindow lays out widgets properly} {
d937 2
a938 2
	.p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
                -sticky ""
d948 7
a954 4
    destroy .p .p.f .p.f2
    set result
} [list 80 30 10 5 50 5 60 30 0 5 30 5]
test panedwindow-13.4 {vertical panedwindow lays out widgets properly} {
d968 7
a974 4
    destroy .p .p.f .p.f2
    set result
} [list 40 60 10 5 10 35 40 50 10 0 10 25]
test panedwindow-13.5 {panedwindow respects reqsize of panes when possible} {
d983 6
a988 4
    destroy .p .p.f
    set result
} [list 20 30]
test panedwindow-13.6 {panedwindow takes explicit widget width over reqwidth} {
d997 6
a1002 4
    destroy .p .p.f
    set result
} [list 20 20]
test panedwindow-13.7 {horizontal panedwindow reqheight is max slave height} {
d1008 6
a1013 4
    destroy .p .p.f .p.f2
    set result
} {20 40}
test panedwindow-13.8 {horizontal panedwindow reqheight is max slave height} {
d1020 6
a1025 4
    destroy .p .p.f .p.f2
    set result
} {20 20}
test panedwindow-13.9 {panedwindow pane width overrides widget width} {
d1034 6
a1039 4
    destroy .p .p.f .p.f2
    set result
} [list 10 10]
test panedwindow-13.10 {panedwindow respects reqsize of panes when possible} {
d1048 6
a1053 4
    destroy .p .p.f
    set result
} [list 20 30]
test panedwindow-13.11 {panedwindow takes explicit height over reqheight} {
d1062 6
a1067 4
    destroy .p .p.f
    set result
} [list 20 20]
test panedwindow-13.12 {vertical panedwindow reqwidth is max slave width} {
d1074 6
a1079 4
    destroy .p .p.f .p.f2
    set result
} {20 40}
test panedwindow-13.13 {vertical panedwindow reqwidth is max slave width} {
d1087 6
a1092 5
    destroy .p .p.f .p.f2
    set result
} {20 20}
test panedwindow-13.14 {panedwindow pane height overrides widget width} {
    destroy .p
d1102 3
a1104 3
    destroy .p
    set result
} [list 10 10]
d1107 3
a1109 1
test panedwindow-14.1 {PanestructureProc, widget yields managements} {
a1114 1
    destroy .p .b
d1121 4
a1124 2
} ""
test panedwindow-14.2 {PanedWindowLostSlaveProc, widget yields management} {
a1129 1
    destroy .p .b
d1139 331
a1469 1
} {}
a1470 32
set stickysets [list n s e w sn ns en ne wn nw esn nse nsw nsew ""]
set stickygets [list n s e w ns ns ne ne nw nw nes nes nsw nesw ""]
set i 0
foreach s $stickysets g $stickygets {
    test panedwindow-15.[incr i] {panedwindow sticky settings} {
	destroy .p .b
	panedwindow .p -showhandle false
	.p add [button .b]
	.p paneconfigure .b -sticky $s
	set result [.p panecget .b -sticky]
	destroy .p .b
	set result
    } $g
}

set i 0
foreach s [list {}  n  s  e  w ns ew nw ne se sw nse nsw sew new news] \
	x [list 10 10 10 20  0 10  0  0 20 20  0  20   0   0   0    0] \
	y [list 10  0 20 10 10  0 10  0  0 20 20   0   0  20   0    0] \
	w [list 20 20 20 20 20 20 40 20 20 20 20  20  20  40  40   40] \
	h [list 20 20 20 20 20 40 20 20 20 20 20  40  40  20  20   40] {
    test panedwindow-16.[incr i] {panedwindow sticky works} {
	panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
	.p add [frame .p.f -height 20 -width 20 -bg red] -sticky $s
	place .p -width 40 -height 40
	update
	set result [list $s [winfo x .p.f] [winfo y .p.f] \
		[winfo width .p.f] [winfo height .p.f]]
	destroy .p .p.f
	set result
    } [list $s $x $y $w $h]
}
d1472 3
a1474 1
test panedwindow-17.1 {setting minsize when pane is too small snaps width} {
d1480 4
a1483 3
    destroy .p .p.f .p.f2
    set result
} [list 20 40]
d1485 2
a1486 1
test panedwindow-18.1 {MoveSash, move right} {
d1488 1
d1491 1
a1491 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1504 6
a1509 7
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 42 42 {30 0}]
test panedwindow-18.2 {MoveSash, move right (unmapped) clipped by reqwidth} {
d1512 1
a1512 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1519 7
a1525 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 40 0]
test panedwindow-18.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} {
d1528 1
a1528 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1539 7
a1545 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 30 0]
test panedwindow-18.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} {
d1548 1
a1548 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1559 7
a1565 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 100 0]
test panedwindow-18.5 {MoveSash, move right respects minsize} {
d1568 1
a1568 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1575 7
a1581 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 30 0]
test panedwindow-18.6 {MoveSash, move right respects minsize} {
d1584 1
a1584 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1590 7
a1596 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 40 0]
test panedwindow-18.7 {MoveSash, move right pushes other sashes} {
d1599 1
a1599 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1606 7
a1612 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 62 0]
test panedwindow-18.8 {MoveSash, move right pushes other sashes, respects minsize} {
d1615 1
a1615 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1622 7
a1628 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 52 0]
test panedwindow-18.9 {MoveSash, move right respects minsize, exludes pad} {
d1631 2
a1632 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize 10 -padx 5
d1639 7
a1645 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 50 0]
test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} {
d1648 2
a1649 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize -50
d1656 7
a1662 8
    set result [list [.p sash coord 0] [.p sash coord 1]]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list [list 50 0] [list 52 0]]
test panedwindow-18.11 {MoveSash, move left} {
d1666 1
a1666 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1679 6
a1684 7
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 42 42 {10 0}]
test panedwindow-18.12 {MoveSash, move left, can't move outside of window} {
d1687 1
a1687 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1694 7
a1700 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 0 0]
test panedwindow-18.13 {MoveSash, move left respects minsize} {
d1703 1
a1703 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1710 7
a1716 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 10 0]
test panedwindow-18.14 {MoveSash, move left respects minsize} {
d1719 1
a1719 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1725 7
a1731 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 22 0]
test panedwindow-18.15 {MoveSash, move left pushes other sashes} {
d1734 1
a1734 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1741 7
a1747 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 0]
test panedwindow-18.16 {MoveSash, move left pushes other sashes, respects minsize} {
d1750 1
a1750 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1757 7
a1763 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 10 0]
test panedwindow-18.17 {MoveSash, move left respects minsize, exludes pad} {
d1766 2
a1767 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize 10 -padx 5
d1774 7
a1780 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 42 0]
test panedwindow-18.18 {MoveSash, move left, negative minsize becomes 0} {
d1783 2
a1784 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize -50
d1791 4
a1794 4
    set result [list [.p sash coord 0] [.p sash coord 1]]
    
    # Cleanup
    destroy .p .f1 .f2 .f3
a1795 2
    set result
} [list [list 8 0] [list 10 0]]
d1797 3
a1799 1
test panedwindow-19.1 {MoveSash, move down} {
d1804 1
a1804 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1817 6
a1822 7
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 42 42 {0 30}]
test panedwindow-19.2 {MoveSash, move down (unmapped) clipped by reqheight} {
d1826 1
a1826 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1833 7
a1839 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 0 40]
test panedwindow-19.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} {
d1843 1
a1843 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1854 7
a1860 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 0 30]
test panedwindow-19.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} {
d1864 1
a1864 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1875 7
a1881 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 0 100]
test panedwindow-19.5 {MoveSash, move down respects minsize} {
d1885 1
a1885 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1892 7
a1898 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 0 30]
test panedwindow-19.6 {MoveSash, move down respects minsize} {
d1902 1
a1902 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1909 7
a1915 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 40]
test panedwindow-19.7 {MoveSash, move down pushes other sashes} {
d1919 1
a1919 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d1926 7
a1932 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 62]
test panedwindow-19.8 {MoveSash, move down pushes other sashes, respects minsize} {
d1936 1
a1936 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d1943 7
a1949 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 52]
test panedwindow-19.9 {MoveSash, move down respects minsize, exludes pad} {
d1953 2
a1954 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize 10 -pady 5
d1961 7
a1967 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 50]
test panedwindow-19.10 {MoveSash, move right, negative minsize becomes 0} {
d1971 2
a1972 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize -50
d1979 7
a1985 8
    set result [list [.p sash coord 0] [.p sash coord 1]]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list [list 0 50] [list 0 52]]
test panedwindow-19.11 {MoveSash, move up} {
d1990 1
a1990 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d2003 6
a2008 7
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 42 42 {0 10}]
test panedwindow-19.12 {MoveSash, move up, can't move outside of window} {
d2012 1
a2012 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d2019 7
a2025 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 0 0]
test panedwindow-19.13 {MoveSash, move up respects minsize} {
d2029 1
a2029 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d2036 7
a2042 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2

    set result
} [list 0 10]
test panedwindow-19.14 {MoveSash, move up respects minsize} {
d2046 1
a2046 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d2052 7
a2058 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 22]
test panedwindow-19.15 {MoveSash, move up pushes other sashes} {
d2062 1
a2062 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
d2069 7
a2075 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 0]
test panedwindow-19.16 {MoveSash, move up pushes other sashes, respects minsize} {
d2079 1
a2079 1
	.p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
d2086 7
a2092 8
    set result [.p sash coord 0]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 10]
test panedwindow-19.17 {MoveSash, move up respects minsize, exludes pad} {
d2096 2
a2097 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize 10 -pady 5
d2104 7
a2110 8
    set result [.p sash coord 1]
    
    # Cleanup
    destroy .p .f1 .f2 .f3

    set result
} [list 0 42]
test panedwindow-19.18 {MoveSash, move up, negative minsize becomes 0} {
d2114 2
a2115 2
	.p add [frame $w -height 20 -width 20 -bg $c] \
		-sticky nsew -minsize -50
d2122 4
a2125 4
    set result [list [.p sash coord 0] [.p sash coord 1]]
    
    # Cleanup
    destroy .p .f1 .f2 .f3
a2126 2
    set result
} [list [list 0 8] [list 0 10]]
d2132 3
a2134 1
test panedwindow-20.1 {ComputeGeometry, reqheight taken from widgets} {
d2137 1
a2137 1
	.p add [frame $w -width 20 -height 20 -bg blue]
d2142 7
a2148 4
    destroy .p .f1 .f2 .f3
    set result
} [list [list 60 20] [list 60 40]]
test panedwindow-20.2 {ComputeGeometry, reqheight taken from widgets} {
d2151 1
a2151 1
	.p add [frame $w -width 20 -height 20 -bg blue]
d2156 7
a2162 4
    destroy .p .f1 .f2 .f3
    set result
} [list [list 60 20] [list 60 40]]
test panedwindow-20.3 {ComputeGeometry, reqheight taken from widgets} {
d2165 1
a2165 1
	.p add [frame $w -width 20 -height 20 -bg blue] -pady 20
d2170 7
a2176 4
    destroy .p .f1 .f2 .f3
    set result
} [list [list 60 60] [list 60 80]]
test panedwindow-20.4 {ComputeGeometry, reqwidth taken from widgets} {
d2185 7
a2191 4
    destroy .p .f1 .f2 .f3
    set result
} [list [list 20 60] [list 40 60]]
test panedwindow-20.5 {ComputeGeometry, reqwidth taken from widgets} {
d2200 7
a2206 4
    destroy .p .f1 .f2 .f3
    set result
} [list [list 20 60] [list 40 60]]
test panedwindow-20.6 {ComputeGeometry, reqwidth taken from widgets} {
d2215 2068
a4282 3
    destroy .p .f1 .f2 .f3
    set result
} [list [list 60 60] [list 80 60]]
a4283 146
set i 6
foreach bd {0 2} {
    foreach sp {0 5} {
	foreach sw {0 3} {
	    foreach h {0 1} {
		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry, one slave, reqsize set properly} {
		    # With just one slave, sashpad and sashwidth should not
		    # affect the panedwindow's geometry, since no sash should
		    # ever be drawn.
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -sashwidth $sw -handlesize 6 -showhandle $h
		    .p add [frame .p.f -width 20 -height 20 -bg red] -padx $h \
                            -sticky ""
		    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
		    destroy .p .p.f
		    set result
		} [list [expr {(2 * $bd) + 20 + (2 * $h)}] \
			[expr {(2 * $bd) + 20}]]
		
		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry, three panes, reqsize set properly} {
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -sashwidth $sw -handlesize 6 -showhandle $h
		    foreach w {.p.f1 .p.f2 .p.f3} {
			.p add [frame $w -width 20 -height 20 -bg blue] \
                                -sticky ""
		    }
		    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
		    destroy .p .p.f1 .p.f2 .p.f3
		    set result
		} [list [expr {(2 * $bd) + ($h?12:(2*$sw)) + (4*$sp) + 60}] \
			[expr {(2 * $bd) + 20}]]
		
		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry, sash coords} {
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -sashwidth $sw -handlesize 6 -showhandle $h
		    foreach w {.f1 .f2 .f3} {
			.p add [frame $w -width 20 -height 20 -bg blue] \
                                -sticky ""
		    }
		    set result [list [.p sash coord 0] [.p sash coord 1]]
		    destroy .p .f1 .f2 .f3
		    set result
		} [list [list [expr {$bd+20+($h?(6-$sw)/2:0)+$sp}] $bd] \
			[list [expr {$bd+40+($h?6+(6-$sw)/2:$sw)+(3*$sp)}] \
			    $bd]]

		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry/ArrangePanes, slave coords} {
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -sashwidth $sw -handlesize 6 -showhandle $h
		    foreach w {.p.f1 .p.f2 .p.f3} {
			.p add [frame $w -width 20 -height 20 -bg blue] \
				-sticky nsew -pady 3 -padx 11
		    }
		    pack .p
		    update
		    set result {}
		    foreach w {.p.f1 .p.f2 .p.f3} {
			lappend result [list [winfo x $w] [winfo y $w] \
				[winfo width $w] [winfo height $w]]
		    }
		    destroy .p .p.f1 .p.f2 .p.f3
		    set result
		} [list [list [expr {$bd+11}] [expr {$bd+3}] 20 20] \
			[list [expr {$bd+53+($h?6:$sw)+(2*$sp)}] \
			    [expr {$bd+3}] 20 20] \
			[list [expr {$bd+95+($h?12:2*$sw)+(4*$sp)}] \
			    [expr {$bd+3}] 20 20]]
		
		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry, one slave, vertical} {
		    # With just one slave, sashpad and sashwidth should not
		    # affect the panedwindow's geometry, since no sash should
		    # ever be drawn.
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -orient vertical -sashwidth $sw -handlesize 6 \
			    -showhandle $h
		    .p add [frame .f -width 20 -height 20 -bg red] -pady $h \
                            -sticky ""
		    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
		    destroy .p .f
		    set result
		} [list [expr {(2 * $bd) + 20}] \
			[expr {(2 * $bd) + 20 + (2 * $h)}]]
		
		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry, three panes, vertical} {
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -sashwidth $sw -handlesize 6 -showhandle $h \
			    -orient vertical
		    foreach w {.f1 .f2 .f3} {
			.p add [frame $w -width 20 -height 20 -bg blue] \
                                -sticky ""
		    }
		    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
		    destroy .p .f1 .f2 .f3
		    set result
		} [list [expr {(2 * $bd) + 20}] \
			[expr {(2 * $bd) + ($h?12:(2*$sw)) + (4*$sp) + 60}]]
		
		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry, sash coords, vertical} {
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -sashwidth $sw -handlesize 6 -showhandle $h \
			    -orient vertical
		    foreach w {.f1 .f2 .f3} {
			.p add [frame $w -width 20 -height 20 -bg blue] \
                                -sticky ""
		    }
		    set result [list [.p sash coord 0] [.p sash coord 1]]
		    destroy .p .f1 .f2 .f3
		    set result
		} [list [list $bd [expr {$bd+20+($h?(6-$sw)/2:0)+$sp}]] \
			[list $bd \
			    [expr {$bd+40+($h?6+(6-$sw)/2:$sw)+(3*$sp)}]]]

		test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
			{ComputeGeometry/ArrangePanes, slave coords, vert} {
		    panedwindow .p -borderwidth $bd -sashpad $sp \
			    -sashwidth $sw -handlesize 6 -showhandle $h \
			    -orient vertical
		    foreach w {.p.f1 .p.f2 .p.f3} {
			.p add [frame $w -width 20 -height 20 -bg blue] \
				-sticky nsew -pady 11 -padx 3
		    }
		    pack .p
		    update
		    set result {}
		    foreach w {.p.f1 .p.f2 .p.f3} {
			lappend result [list [winfo x $w] [winfo y $w] \
				[winfo width $w] [winfo height $w]]
		    }
		    destroy .p .p.f1 .p.f2 .p.f3
		    set result
		} [list [list [expr {$bd+3}] [expr {$bd+11}] 20 20] \
			[list [expr {$bd+3}] \
			    [expr {$bd+53+($h?6:$sw)+(2*$sp)}] 20 20] \
			[list [expr {$bd+3}] \
			    [expr {$bd+95+($h?12:2*$sw)+(4*$sp)}] 20 20]]
	    }
	}
    }
}
d4285 3
a4287 1
test panedwindow-21.1 {destroyed widgets are removed from panedwindow} {
d4291 7
a4297 5
    set result [.p panes]
    destroy .p
    set result
} {}
test panedwindow-21.2 {destroyed slave causes geometry recomputation} {
d4302 4
a4305 4
    set result [winfo reqwidth .p]
    destroy .p .f2
    set result
} 20
d4307 4
a4310 1
test panedwindow-22.1 {ArrangePanes, extra space is given to the last pane} {
d4316 7
a4322 5
    set result [winfo width .f2]
    destroy .p .f1 .f2
    set result
} 78
test panedwindow-22.2 {ArrangePanes, extra space is given to the last pane} {
d4329 7
a4335 5
    set result [winfo height .f2]
    destroy .p .f1 .f2
    set result
} 78
test panedwindow-22.3 {ArrangePanes, explicit height/width are preferred} {
d4342 7
a4348 5
    set result [list [winfo width .f1] [winfo height .f1]]
    destroy .p .f1 .f2
    set result
} {10 15}
test panedwindow-22.4 {ArrangePanes, panes clipped by size of pane} {
d4355 7
a4361 5
    set result [list [winfo width .f1] [winfo height .f1]]
    destroy .p .f1 .f2
    set result
} {10 20}
test panedwindow-22.5 {ArrangePanes, panes clipped by size of pane} {
d4369 7
a4375 5
    set result [list [winfo width .f1] [winfo height .f1]]
    destroy .p .f1 .f2
    set result
} {20 10}
test panedwindow-22.6 {ArrangePanes, height of pane taken from total height} {
d4381 7
a4387 5
    set result [list [winfo y .p.f1]]
    destroy .p .p.f1 .p.f2
    set result
} 10
test panedwindow-22.8 {ArrangePanes, width of pane taken from total width} {
d4394 7
a4400 5
    set result [list [winfo x .p.f1]]
    destroy .p .p.f1 .p.f2
    set result
} 10
test panedwindow-22.9 {ArrangePanes, panes with width <= 0 are unmapped} {
d4410 6
a4415 4
    destroy .p .f1 .f2
    set result
} {1 0}
test panedwindow-22.10 {ArrangePanes, panes with width <= 0 are unmapped} {
d4425 6
a4430 4
    destroy .p .p.f1 .p.f2
    set result
} {1 0}
test panedwindow-22.11 {ArrangePanes, panes with width <= 0 are unmapped} {
d4440 6
a4445 4
    destroy .p .p.f1 .p.f2
    set result
} {1 0}
test panedwindow-22.12 {ArrangePanes, last pane shrinks} {
d4451 7
a4457 5
    set result [winfo width .f2]
    destroy .p .f1 .f2
    set result
} 18
test panedwindow-22.13 {ArrangePanes, last pane shrinks} {
d4464 7
a4470 6
    set result [winfo height .f2]
    destroy .p .f1 .f2
    set result
} 18
test panedwindow-22.14 {ArrangePanes, panedwindow resizes} {
    -body {
d4478 6
a4483 6
    }
    -cleanup {destroy .p .f1}
    -result {200 1 200 50}
}
test panedwindow-22.15 {ArrangePanes, panedwindow resizes} {
    -body {
d4491 6
a4496 6
    }
    -cleanup {destroy .p .f1}
    -result {1 200 50 200}
}
test panedwindow-22.16 {ArrangePanes, last pane grows} {
    -body {
d4510 3
a4512 4
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {50 150 1 1 211 50 150 1 89 300}
}
d4515 3
a4517 1
test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} {
d4525 6
a4530 4
    destroy .p .f1 .f2
    set result
} {40 80}
test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} {
d4538 24
a4561 16
} {10}


test panedwindow-24.1 {ConfigurePanes, can't add panedwindow to itself} {
    panedwindow .p
    set result [list [catch {.p add .p} msg] $msg]
    destroy .p
    set result
} [list 1 "can't add .p to itself"]
test panedwindow-24.2 {ConfigurePanes, bad window throws error} {
    panedwindow .p
    set result [list [catch {.p add .b} msg] $msg]
    destroy .p
    set result
} [list 1 "bad window path name \".b\""]
test panedwindow-24.3 {ConfigurePanes, bad window aborts processing} {
d4565 7
a4571 5
    set result [.p panes]
    destroy .p .b
    set result
} {}
test panedwindow-24.4 {ConfigurePanes, bad option aborts processing} {
d4575 7
a4581 5
    set result [.p panes]
    destroy .p .b
    set result
} {}
test panedwindow-24.5 {ConfigurePanes, after win isn't managed by panedwin} {
d4585 7
a4591 5
    set result [list [catch {.p add .b -after .c} msg] $msg]
    destroy .p .b .c
    set result
} [list 1 "window \".c\" is not managed by .p"]
test panedwindow-24.6 {ConfigurePanes, before win isn't managed by panedwin} {
d4595 7
a4601 5
    set result [list [catch {.p add .b -before .c} msg] $msg]
    destroy .p .b .c
    set result
} [list 1 "window \".c\" is not managed by .p"]
test panedwindow-24.7 {ConfigurePanes, -after {} is a no-op} {
d4605 7
a4611 5
    set result [.p panes]
    destroy .p .b .c
    set result
} {.b .c}
test panedwindow-24.8 {ConfigurePanes, -before {} is a no-op} {
d4615 7
a4621 5
    set result [.p panes]
    destroy .p .b .c
    set result
} {.b .c}
test panedwindow-24.9 {ConfigurePanes, new panes are added} {
d4624 7
a4630 5
    set result [.p panes]
    destroy .p .b .c
    set result
} {.b .c}
test panedwindow-24.10 {ConfigurePanes, options applied to all panes} {
d4635 14
a4648 11
	set val {}
	foreach option {-sticky -height -width -minsize} {
	    lappend val $option [.p panecget $w $option]
	}
	lappend result $w $val
    }
    destroy .p .b .c
    set result
} [list .b {-sticky ne -height 5 -width 5 -minsize 10} \
	.c {-sticky ne -height 5 -width 5 -minsize 10}]
test panedwindow-24.11 {ConfigurePanes, existing panes are reconfigured} {
d4652 8
a4659 7
    set result [list [.p panes] \
	    [.p panecget .b -sticky] [.p panecget .b -height] \
	    [.p panecget .c -sticky] [.p panecget .c -height]]
    destroy .p .b .c
    set result
} [list {.b .c} es 2 es 2]
test panedwindow-24.12 {ConfigurePanes, widgets added to end by default} {
d4664 7
a4670 5
    set result [.p panes]
    destroy .p .b .c .d
    set result
} {.b .c .d}
test panedwindow-24.13 {ConfigurePanes, -after, single addition} {
d4678 7
a4684 5
    set result [.p panes]
    destroy .p .a .b .c
    set result
} {.a .c .b}
test panedwindow-24.14 {ConfigurePanes, -after, multiple additions} {
d4693 7
a4699 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.a .c .d .b}
test panedwindow-24.15 {ConfigurePanes, -after, relocates existing widget} {
d4708 7
a4714 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.a .d .b .c}
test panedwindow-24.16 {ConfigurePanes, -after, relocates existing widgets} {
d4723 7
a4729 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.a .b .d .c}
test panedwindow-24.17 {ConfigurePanes, -after, relocates existing widgets} {
d4738 7
a4744 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.b .d .a .c}
test panedwindow-24.18 {ConfigurePanes, -after, relocates existing widgets} {
d4753 7
a4759 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.d .a .b .c}
test panedwindow-24.19 {ConfigurePanes, -after, after last window} {
d4768 7
a4774 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.a .b .c .d}
test panedwindow-24.20 {ConfigurePanes, -before, before first window} {
d4783 7
a4789 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.d .a .b .c}
test panedwindow-24.21 {ConfigurePanes, -before, relocate existing windows} {
d4798 7
a4804 5
    set result [.p panes]
    destroy .p .a .b .c .d
    set result
} {.d .b .a .c}
test panedwindow-24.22 {ConfigurePanes, slave specified multiple times} {
d4813 7
a4819 5
    set result [.p panes]
    destroy .p .a .b .c
    set result
} {.a .b .c}
test panedwindow-24.23 {ConfigurePanes, slave specified multiple times} {
d4829 7
a4835 5
    set result [.p panes]
    destroy .p .a .b .c
    set result
} {.c .a .b}
test panedwindow-24.24 {ConfigurePanes, panedwindow cannot manage toplevels} {
d4838 7
a4844 5
    set result [list [catch {.p add .t} msg] $msg]
    destroy .p .t
    set result
} [list 1 "can't add toplevel .t to .p"]
test panedwindow-24.25 {ConfigurePanes, restrict possible panes} {
d4848 7
a4854 5
    set result [list [catch {.p add .f.b} msg] $msg]
    destroy .p .f .f.b
    set result
} [list 1 "can't add .f.b to .p"]
test panedwindow-24.26 {ConfigurePanes, restrict possible panes} {
d4858 7
a4864 5
    set result [list [catch {.f.p add .b} msg] $msg]
    destroy .f.p .f .b
    set result
} [list 0 ""]
test panedwindow-24.27 {ConfigurePanes, restrict possible panes} {
d4867 7
a4873 5
    set result [list [catch {.p add .p.b} msg] $msg]
    destroy .p .p.b
    set result
} [list 0 ""]
test panedwindow-24.28 {ConfigurePanes, restrict possible panes} {
d4879 7
a4885 6
    set result [list [catch {.f.f.f.p add .b} msg] $msg]
    destroy .f .f.f .f.f.f .f.f.f.p .b
    set result
} [list 0 ""]
test panedwindow-24.29.1 {ConfigurePanes, -hide works} {
    -body {
d4905 6
a4910 6
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
}
test panedwindow-24.29.2 {ConfigurePanes, -hide works} {
    -body {
d4930 6
a4935 6
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130}
}
test panedwindow-24.29.3 {ConfigurePanes, -hide works, last pane stretches} {
    -body {
d4947 7
a4953 7
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
    }
    -cleanup {destroy .p .f1 .f2 .f3}
    -result {50 50 94 50 50 147}
}
test panedwindow-24.29.4 {ConfigurePanes, -hide works, last pane stretches} {
    -body {
d4967 7
a4973 7
    }
    -cleanup {destroy .p .f1 .f2 .f3}
    -result {50 50 94 50 50 147}
}

test panedwindow-24.30 {ConfigurePanes, -stretch first} {
    -body {
d4989 6
a4994 6
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {51 40 40 40 94 40 40 40}
}
test panedwindow-24.31 {ConfigurePanes, -stretch middle} {
    -body {
d5010 6
a5015 6
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {40 45 46 40 40 45 94 40}
}
test panedwindow-24.32 {ConfigurePanes, -stretch always} {
    -body {
d5031 6
a5036 6
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {42 43 43 43 58 43 58 58}
}
test panedwindow-24.33 {ConfigurePanes, -stretch never} {
    -body {
d5052 4
a5055 4
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {40 40 40 40 40 40 40 40}
}
d5057 3
a5059 1
test panedwindow-25.1 {Unlink, remove a paned with -before/-after refs} {
d5074 4
a5077 3
    destroy .pw
    set result
} {.pw.l3 {} .pw.l1}
d5079 3
a5081 1
test panedwindow-26.1 {DestroyPanedWindow} {
d5085 1
a5085 1
	.p add [button $w]
d5088 1
a5088 1
	destroy $w
d5091 1
a5091 1
} {}
d5093 4
a5096 1
test panedwindow-27.1 {PanedWindowIdentifyCoords} {
d5100 7
a5106 5
    set result [.p identify 0 0]
    destroy .p .f .f2
    set result
} {}
test panedwindow-27.2 {PanedWindowIdentifyCoords, padding is included} {
d5110 7
a5116 5
    set result [.p identify 20 0]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.3 {PanedWindowIdentifyCoords} {
d5120 7
a5126 5
    set result [.p identify 22 0]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.4 {PanedWindowIdentifyCoords} {
d5130 7
a5136 5
    set result [.p identify 24 0]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.5 {PanedWindowIdentifyCoords} {
d5140 7
a5146 5
    set result [.p identify 26 0]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.6 {PanedWindowIdentifyCoords} {
d5150 7
a5156 5
    set result [.p identify 26 -1]
    destroy .p .f .f2
    set result
} {}
test panedwindow-27.7 {PanedWindowIdentifyCoords} {
d5160 7
a5166 5
    set result [.p identify 26 100]
    destroy .p .f .f2
    set result
} {}
test panedwindow-27.8 {PanedWindowIdentifyCoords} {
d5171 7
a5177 5
    set result [.p identify 22 4]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.9 {PanedWindowIdentifyCoords} {
d5182 7
a5188 5
    set result [.p identify 22 5]
    destroy .p .f .f2
    set result
} {0 handle}
test panedwindow-27.10 {PanedWindowIdentifyCoords} {
d5193 7
a5199 5
    set result [.p identify 20 5]
    destroy .p .f .f2
    set result
} {0 handle}
test panedwindow-27.11 {PanedWindowIdentifyCoords} {
d5204 7
a5210 5
    set result [.p identify 20 0]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.12 {PanedWindowIdentifyCoords} {
d5215 7
a5221 5
    set result [.p identify 48 0]
    destroy .p .f .f2 .f3
    set result
} {1 sash}
test panedwindow-27.13 {identify subcommand errors} {
d5223 23
a5245 17
    set result [list [catch {.p identify} msg] $msg]
    destroy .p
    set result
} [list 1 "wrong # args: should be \".p identify x y\""]
test panedwindow-27.14 {identify subcommand errors} {
    panedwindow .p
    set result [list [catch {.p identify foo bar} msg] $msg]
    destroy .p
    set result
} [list 1 "expected integer but got \"foo\""]
test panedwindow-27.14a {identify subcommand errors} {
    panedwindow .p
    set result [list [catch {.p identify 0 bar} msg] $msg]
    destroy .p
    set result
} [list 1 "expected integer but got \"bar\""]
test panedwindow-27.15 {PanedWindowIdentifyCoords} {
d5249 7
a5255 5
    set result [.p identify 0 0]
    destroy .p .f .f2
    set result
} {}
test panedwindow-27.16 {PanedWindowIdentifyCoords, padding is included} {
d5259 7
a5265 5
    set result [.p identify 0 20]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.17 {PanedWindowIdentifyCoords} {
d5269 7
a5275 5
    set result [.p identify 0 22]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.18 {PanedWindowIdentifyCoords} {
d5279 7
a5285 5
    set result [.p identify 0 24]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.19 {PanedWindowIdentifyCoords} {
d5289 7
a5295 5
    set result [.p identify 0 26]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.20 {PanedWindowIdentifyCoords} {
d5299 7
a5305 5
    set result [.p identify -1 26]
    destroy .p .f .f2
    set result
} {}
test panedwindow-27.21 {PanedWindowIdentifyCoords} {
d5309 7
a5315 5
    set result [.p identify 100 26]
    destroy .p .f .f2
    set result
} {}
test panedwindow-27.22 {PanedWindowIdentifyCoords} {
d5320 7
a5326 5
    set result [.p identify 4 22]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.23 {PanedWindowIdentifyCoords} {
d5331 7
a5337 5
    set result [.p identify 5 22]
    destroy .p .f .f2
    set result
} {0 handle}
test panedwindow-27.24 {PanedWindowIdentifyCoords} {
d5342 7
a5348 5
    set result [.p identify 5 20]
    destroy .p .f .f2
    set result
} {0 handle}
test panedwindow-27.25 {PanedWindowIdentifyCoords} {
d5353 7
a5359 5
    set result [.p identify 0 20]
    destroy .p .f .f2
    set result
} {0 sash}
test panedwindow-27.26 {PanedWindowIdentifyCoords} {
d5364 16
a5379 9
    set result [.p identify 0 48]
    destroy .p .f .f2 .f3
    set result
} {1 sash}

test panedwindow-28.1 {destroy the window cleanly on error [Bug #616589]} {
    list [catch {panedwindow .p -bogusopt bogus} msg] $msg
} {1 {unknown option "-bogusopt"}}
test panedwindow-28.2 {destroy the window cleanly on rename [Bug #616589]} {
d5384 57
a5440 52
} {0}


test panedwindow-29.1 {resizing width} {
    -body {
        panedwindow .p -bd 5
        frame .f1 -width 100 -height 50 -bg blue
        frame .f2 -width 100 -height 50 -bg red

        .p add .f1 -sticky news
        .p add .f2 -sticky news
        pack .p -side top -fill both -expand 1
        wm geometry . ""
        update
        # Note the width
        set a [winfo width .f2]
        # Increase the size by 10
        regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
        wm geometry . [expr {$w + 10}]x$h
        update
        set b "$a [winfo width .f2]"
    }
    -cleanup {destroy .p .f1 .f2}
    -result {100 110}
}

test panedwindow-29.2 {resizing height} {
    -body {
        panedwindow .p -orient vertical -bd 5
        frame .f1 -width 50 -height 100 -bg blue
        frame .f2 -width 50 -height 100 -bg red

        .p add .f1 -sticky news
        .p add .f2 -sticky news
        pack .p -side top -fill both -expand 1
        wm geometry . ""
        update
        # Note the height
        set a [winfo height .f2]
        # Increase the size by 10
        regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
        wm geometry . ${w}x[expr {$h + 10}]
        update
        set b "$a [winfo height .f2]"
    }
    -cleanup {destroy .p .f1 .f2}
    -result {100 110}
}

test panedwindow-30.1 {display on depths other than the default one} {
    -constraints {pseudocolor8 haveTruecolor24}
    -body {
d5446 8
a5453 7
    }
    -cleanup {destroy .t}
    -result {}
}
test panedwindow-30.2 {display on depths other than the default one} {
    -constraints {pseudocolor8 haveTruecolor24}
    -body {
d5464 4
a5467 4
    }
    -cleanup {destroy .t}
    -result {}
}
d5472 2
@


1.21
log
@	* tests/listbox.test, tests/panedwindow.test, tests/scrollbar.test:
	* library/bgerror.tcl, library/dialog.tcl, library/listbox.tcl:
	* library/msgbox.tcl, library/optMenu.tcl, library/tclIndex:
	* library/tkfbox.tcl, library/demos/floor.tcl, library/demos/rmt:
	* library/demos/tcolor, library/demos/text.tcl:
	* library/demos/twind.tcl, library/demos/widget: Buh-bye Motif look
	* library/ttk/fonts.tcl:    Update of Tk default look in 8.5
	* macosx/tkMacOSXDefault.h: Trims border sizes, cleaner X11 look
	* unix/tkUnixDefault.h:     with minor modifications for Win32/Aqua.
	* win/tkWinDefault.h:       Uses Tk*Font definitions throughout for
	* win/tkWinFont.c:          classic widgets. [Bug #1820344]
	* library/obsolete.tcl (::tk::classic::restore): This restores
	changes made to defaults in 8.5 using the 'option' command,
	segmented into logical groups.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.20 2005/05/31 05:23:44 hobbs Exp $
@


1.20
log
@	* generic/tkPanedWindow.c, tests/panedwindow.test: batch of fixes
	to panedwindow from Daniel South.  Improved auto-size to fit
	internal windows, fixed sash placement at edge of pane, fixed
	calculation of stretch amount for internal windows.
	[Bug 1124198 1161543 1054117 1010941 795869 690169 1192323]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.19 2004/12/04 00:04:41 dkf Exp $
d1952 1
a1952 1
    -result {50 150 1 1 222 50 150 1 78 300}
d2285 1
a2285 1
    -result {1 1 1 1 40 40 40 40 182 1 0 1 1 40 40 40 40 136}
d2310 1
a2310 1
    -result {1 1 1 0 28 40 40 1 130 1 0 1 1 40 40 40 34 130}
d2328 1
a2328 1
    -result {50 50 88 50 50 144}
d2347 1
a2347 1
    -result {50 50 88 50 50 144}
d2369 1
a2369 1
    -result {40 40 40 40 86 40 40 40}
d2390 1
a2390 1
    -result {40 40 40 40 40 40 86 40}
d2411 1
a2411 1
    -result {40 40 40 40 55 40 55 56}
@


1.20.2.1
log
@merge updates from HEAD
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.20 2005/05/31 05:23:44 hobbs Exp $
d1952 1
a1952 1
    -result {50 150 1 1 211 50 150 1 89 300}
d2285 1
a2285 1
    -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
d2310 1
a2310 1
    -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130}
d2328 1
a2328 1
    -result {50 50 94 50 50 147}
d2347 1
a2347 1
    -result {50 50 94 50 50 147}
d2369 1
a2369 1
    -result {51 40 40 40 94 40 40 40}
d2390 1
a2390 1
    -result {40 45 46 40 40 45 94 40}
d2411 1
a2411 1
    -result {42 43 43 43 58 43 58 58}
@


1.19
log
@Split duplicate test names [Bug 1078648]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.18 2004/10/26 08:07:28 dkf Exp $
d1909 46
d2262 88
a2349 19
test panedwindow-24.29 {ConfigurePanes, -hide works} {
    panedwindow .p 
    frame .f1 -width 10 -bg red
    frame .f2 -width 10 -bg white
    frame .f3 -width 10 -bg blue
    frame .f4 -width 10 -bg green
    .p add .f1 .f2 .f3 .f4
    pack .p -fill both -expand 1
    update
    set result [list]
    lappend result [winfo ismapped .f1] [winfo ismapped .f2] [winfo ismapped .f3] [winfo ismapped .f4]
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    .p paneconfigure .f2 -hide 1
    update
    lappend result [winfo ismapped .f1] [winfo ismapped .f2] [winfo ismapped .f3] [winfo ismapped .f4]
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    destroy .f1 .f2 .f3 .f4 .p
    set result
} [list 1 1 1 1 10 10 10 10 1 0 1 1 10 10 10 24]
d2351 20
a2370 16
    panedwindow .p 
    frame .f1 -width 10 -bg red
    frame .f2 -width 10 -bg white
    frame .f3 -width 10 -bg blue
    frame .f4 -width 10 -bg green
    .p add .f1 .f2 .f3 .f4 -stretch first
    pack .p -fill both -expand 1
    update
    set result [list]
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    .p paneconfigure .f2 -hide 1
    update
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    destroy .f1 .f2 .f3 .f4 .p
    set result
} [list 10 10 10 10 24 10 10 10]
d2372 20
a2391 16
    panedwindow .p 
    frame .f1 -width 10 -bg red
    frame .f2 -width 10 -bg white
    frame .f3 -width 10 -bg blue
    frame .f4 -width 10 -bg green
    .p add .f1 .f2 .f3 .f4 -stretch middle
    pack .p -fill both -expand 1
    update
    set result [list]
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    .p paneconfigure .f2 -hide 1
    update
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    destroy .f1 .f2 .f3 .f4 .p
    set result
} [list 10 10 10 10 10 10 24 10]
d2393 20
a2412 16
    panedwindow .p 
    frame .f1 -width 10 -bg red
    frame .f2 -width 10 -bg white
    frame .f3 -width 10 -bg blue
    frame .f4 -width 10 -bg green
    .p add .f1 .f2 .f3 .f4 -stretch always
    pack .p -fill both -expand 1
    update
    set result [list]
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    .p paneconfigure .f2 -hide 1
    update
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    destroy .f1 .f2 .f3 .f4 .p
    set result
} [list 10 10 10 10 14 10 14 14]
d2414 20
a2433 16
    panedwindow .p 
    frame .f1 -width 10 -bg red
    frame .f2 -width 10 -bg white
    frame .f3 -width 10 -bg blue
    frame .f4 -width 10 -bg green
    .p add .f1 .f2 .f3 .f4 -stretch never
    pack .p -fill both -expand 1
    update
    set result [list]
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    .p paneconfigure .f2 -hide 1
    update
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] [winfo width .f4]
    destroy .f1 .f2 .f3 .f4 .p
    set result
} [list 10 10 10 10 10 10 10 10]
@


1.18
log
@Fix incorrect expected error message
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.17 2004/10/25 15:22:16 dkf Exp $
d2448 1
a2448 1
test panedwindow-27.14 {identify subcommand errors} {
@


1.17
log
@Fix stupid brokenness inroduced by me.  D'oh!
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.16 2004/10/24 17:22:55 dkf Exp $
d76 1
a76 1
    panedwindow-1a.9 {-stretch alw always foo {bad stretch "foo": must be one of always, first, last, middle, or never}}
@


1.16
log
@Add -hide and -stretch options to panedwindow widgets. (TIPs 177 and 179)
Thanks to Brian Griffin for developing these! [Patch 983886]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.15 2004/09/10 06:58:42 hobbs Exp $
d79 1
a79 1
    lassign $test testName optionName goodIn goodOut badIn badOut
@


1.15
log
@bulletproof 23.2 result [Bug #1019100]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.14 2004/05/23 17:34:49 dkf Exp $
d17 36
a52 19
foreach test {
    {-background "#ff0000" "#ff0000" non-existent 
	{unknown color name "non-existent"}}
    {-bd 4 4 badValue {bad screen distance "badValue"}}
    {-bg "#ff0000" "#ff0000" non-existent {unknown color name "non-existent"}}
    {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
    {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
    {-handlesize 20 20 badValue {bad screen distance "badValue"}}
    {-height 20 20 badValue {bad screen distance "badValue"}}
    {-opaqueresize true 1 foo {expected boolean value but got "foo"}}
    {-orient horizontal horizontal badValue 
	{bad orient "badValue": must be horizontal or vertical}}
    {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
    {-sashcursor arrow arrow badValue {bad cursor spec "badValue"}}
    {-sashpad 1.3 1 badValue {bad screen distance "badValue"}}
    {-sashrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
    {-sashwidth 10 10 badValue {bad screen distance "badValue"}}
    {-showhandle true 1 foo {expected boolean value but got "foo"}}
    {-width 402 402 badValue {bad screen distance "badValue"}}
d54 10
a63 13
    set name [lindex $test 0]
    test panedwindow-1.$i {configuration options} {
	.p configure $name [lindex $test 1]
	list [lindex [.p configure $name] 4] [.p cget $name]
    } [list [lindex $test 2] [lindex $test 2]]
    incr i
    if {[lindex $test 3] ne ""} {
	test panedwindow-1.$i {configuration options} {
	    list [catch {.p configure $name [lindex $test 3]} msg] $msg
	} [list 1 [lindex $test 4]]
    }
    .p configure $name [lindex [.p configure $name] 3]
    incr i
d67 11
a77 9
foreach test {
    {-after .c .c badValue {bad window path name "badValue"}}
    {-before .c .c badValue {bad window path name "badValue"}}
    {-height 10 10 badValue {bad screen distance "badValue"}}
    {-minsize 10 10 badValue {bad screen distance "badValue"}}
    {-padx 1.3 1 badValue {bad screen distance "badValue"}}
    {-pady 1.3 1 badValue {bad screen distance "badValue"}}
    {-sticky nsew nesw abcd {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w}}
    {-width 10 10 badValue {bad screen distance "badValue"}}
d79 11
a89 13
    set name [lindex $test 0]
    test panedwindow-1.$i {configuration options} {
	.p paneconfigure .b $name [lindex $test 1]
	list [lindex [.p paneconfigure .b $name] 4] [.p panecget .b $name]
    } [list [lindex $test 2] [lindex $test 2]]
    incr i
    if {[lindex $test 3] ne ""} {
	test panedwindow-1.$i {configuration options} {
	    list [catch {.p paneconfigure .b $name [lindex $test 3]} msg] $msg
	} [list 1 [lindex $test 4]]
    }
    .p paneconfigure .b $name [lindex [.p paneconfigure .b $name] 3]
    incr i
d2216 87
@


1.14
log
@First step towards improving test style.  Also start using Tcl 8.5 features.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.13 2004/05/03 19:16:11 hobbs Exp $
d1914 2
a1915 2
    set result
} {32 42}
@


1.13
log
@	* tests/panedwindow.test: panedwindow-25.1
	* generic/tkPanedWindow.c (Unlink): clean up -before/-after refs
	to a slave when removing it. [Bug #928413] (griffin)
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.12 2003/07/18 10:02:03 dkf Exp $
d43 1
a43 1
    if {[lindex $test 3] != ""} {
d69 1
a69 1
    if {[lindex $test 3] != ""} {
@


1.12
log
@Fix for [Bug 702230], and an evil bug it is too!
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.11 2003/07/17 00:39:53 hobbs Exp $
d2148 1
a2148 1
test panedwindow-22.23 {ConfigurePanes, slave specified multiple times} {
d2162 1
a2162 1
test panedwindow-22.24 {ConfigurePanes, panedwindow cannot manage toplevels} {
d2169 1
a2169 1
test panedwindow-22.25 {ConfigurePanes, restrict possible panes} {
d2177 1
a2177 1
test panedwindow-22.26 {ConfigurePanes, restrict possible panes} {
d2185 1
a2185 1
test panedwindow-22.27 {ConfigurePanes, restrict possible panes} {
d2192 1
a2192 1
test panedwindow-22.28 {ConfigurePanes, restrict possible panes} {
d2203 19
@


1.11
log
@	* generic/tkPanedWindow.c (ArrangePanes): Ensure that the last pane
	* tests/panedwindow.test: shrinks instead of being clipped when
	resized below the reqsize. [Bug 748277] (spjuth)
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.10 2003/05/21 15:31:01 dkf Exp $
d2499 17
@


1.10
log
@The panedwindow widget now sizes right around unmapped windows.  [Bug 738143]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.9 2003/04/01 21:06:49 dgp Exp $
d1874 22
a1895 1
    
@


1.9
log
@        * tests/all.tcl:                Made better use of a common
        * tests/constraints.tcl:        -loadfile to hold definitions
        * tests/*.test:                 common to all test files.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.8 2003/02/21 11:48:56 dkf Exp $
d1886 10
@


1.8
log
@Use the panedwindow's depth, not the screen's default depth. [Bug #671122]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.7 2003/02/21 01:57:51 hobbs Exp $
d12 1
a12 4
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
d2476 1
a2476 1
::tcltest::cleanupTests
@


1.8.2.1
log
@	* generic/tkPanedWindow.c (ArrangePanes): Ensure that the last pane
	* tests/panedwindow.test: shrinks instead of being clipped when
	resized below the reqsize. [Bug 748277] (spjuth)
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.8 2003/02/21 11:48:56 dkf Exp $
d1877 1
a1877 22
test panedwindow-22.12 {ArrangePanes, last pane shrinks} {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    place .p -width 40 -x 0 -y 0
    update
    set result [winfo width .f2]
    destroy .p .f1 .f2
    set result
} 18
test panedwindow-22.13 {ArrangePanes, last pane shrinks} {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    place .p -height 40 -x 0 -y 0
    update
    set result [winfo height .f2]
    destroy .p .f1 .f2
    set result
} 18

@


1.8.2.2
log
@Fix for [Bug 702230], and what an evil bug that is!
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.8.2.1 2003/07/17 00:37:03 hobbs Exp $
a2491 17
	update
	# If we got here, we didn't crash and that's good
    }
    -cleanup {destroy .t}
    -result {}
}
test panedwindow-30.2 {display on depths other than the default one} {
    -constraints {pseudocolor8 haveTruecolor24}
    -body {
	toplevel .t -visual {pseudocolor 8}
	pack [frame .t.f -visual {truecolor 24}]
	pack [panedwindow .t.f.p]
	.t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5]
	update
	.t.f.p proxy place 1 1
	update
	.t.f.p proxy forget
@


1.8.2.3
log
@	* tests/panedwindow.test: panedwindow-25.1
	* generic/tkPanedWindow.c (Unlink): clean up -before/-after refs
	to a slave when removing it. [Bug #928413] (griffin)
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.8.2.2 2003/07/18 09:53:16 dkf Exp $
d2141 1
a2141 1
test panedwindow-24.23 {ConfigurePanes, slave specified multiple times} {
d2155 1
a2155 1
test panedwindow-24.24 {ConfigurePanes, panedwindow cannot manage toplevels} {
d2162 1
a2162 1
test panedwindow-24.25 {ConfigurePanes, restrict possible panes} {
d2170 1
a2170 1
test panedwindow-24.26 {ConfigurePanes, restrict possible panes} {
d2178 1
a2178 1
test panedwindow-24.27 {ConfigurePanes, restrict possible panes} {
d2185 1
a2185 1
test panedwindow-24.28 {ConfigurePanes, restrict possible panes} {
a2195 19
test panedwindow-25.1 {Unlink, remove a paned with -before/-after refs} {
    # Bug 928413
    set result {}
    panedwindow .pw
    label .pw.l1 -text Label1
    label .pw.l2 -text Label2
    label .pw.l3 -text Label3
    .pw add .pw.l1
    .pw add .pw.l3
    .pw add .pw.l2 -before .pw.l3
    lappend result [.pw panecget .pw.l2 -before]
    destroy .pw.l3
    lappend result [.pw panecget .pw.l2 -before]
    .pw paneconfigure .pw.l2 -before .pw.l1
    lappend result [.pw panecget .pw.l2 -before]
    destroy .pw
    set result
} {.pw.l3 {} .pw.l1}

@


1.8.2.4
log
@	* generic/tkPanedWindow.c, tests/panedwindow.test: batch of fixes
	to panedwindow from Daniel South.  Improved auto-size to fit
	internal windows, fixed sash placement at edge of pane, fixed
	calculation of stretch amount for internal windows.
	[Bug 1124198 1161543 1054117 1010941 795869 690169 1192323]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.8.2.3 2004/05/03 19:17:39 hobbs Exp $
a1897 46
test panedwindow-22.14 {ArrangePanes, panedwindow resizes} {
    -body {
	panedwindow .p -width 200 -borderwidth 0
	frame .f1 -height 50 -bg blue
	set result [list]
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
	.p add .f1
	pack .p
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
    }
    -cleanup {destroy .p .f1}
    -result {200 1 200 50}
}
test panedwindow-22.15 {ArrangePanes, panedwindow resizes} {
    -body {
	panedwindow .p -height 200 -borderwidth 0 -orient vertical
	frame .f1 -width 50 -bg blue
	set result [list]
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
	.p add .f1
	pack .p
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
    }
    -cleanup {destroy .p .f1}
    -result {1 200 50 200}
}
test panedwindow-22.16 {ArrangePanes, last pane grows} {
    -body {
	panedwindow .p -showhandle false -height 50
	.p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
		[frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
	.p sash place 1 250 0
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
	.p configure -width 300
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
    }
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
    -result {50 150 1 1 222 50 150 1 78 300}
}

a1909 10
test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} {
    panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 10] [frame .f2 -width 10]
    set result [winfo reqwidth .p]
    .f1 configure -width 20
    lappend result [winfo reqwidth .p]
    destroy .p .f1 .f2
    expr {[lindex $result 1] - [lindex $result 0]}
} {10}

d2340 1
a2340 1
test panedwindow-27.14a {identify subcommand errors} {
@


1.7
log
@	* tests/panedwindow.test:
	* generic/tkPanedWindow.c (ValidSashIndex): corrected to note that
	2 panes must exist before any one sash does. [tcllib Bug #689258]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.6 2003/02/20 21:08:30 pspjuth Exp $
d2463 13
@


1.6
log
@Fixed calculation of the last slave's
size when increasing the size of the panedwindow. [Bug #689099]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.5 2002/09/30 18:55:57 hobbs Exp $
d246 1
d251 12
d265 1
d269 1
a269 1
} [list 1 "invalid sash index" 0 1 "invalid sash index"]
d388 1
d390 1
a390 3
    set result [list [catch {.p sash place foo bar baz} msg] $msg]
    destroy .p
    set result
d393 1
d395 1
a395 3
    set result [list [catch {.p sash place 0 foo bar} msg] $msg]
    destroy .p
    set result
d398 1
d401 1
a401 3
    set result [list [catch {.p sash place 0 foo bar} msg] $msg]
    destroy .p .b .c
    set result
d404 1
d407 1
a407 3
    set result [list [catch {.p sash place 0 0 bar} msg] $msg]
    destroy .p .b .c
    set result
d410 1
d414 1
a414 3
    set result [.p sash coord 0]
    destroy .p .f .c
    set result
d417 1
d421 1
a421 3
    set result [.p sash coord 0]
    destroy .p .f .c
    set result
d424 1
d428 3
a430 1
    set result [.p sash coord 0]
d432 4
a435 2
    set result
} [list 15 0]
d438 1
d444 1
a444 3
    set result [winfo width .f]
    destroy .p .f .c
    set result
d447 1
a455 2
    destroy .p .f .f2
    set result
d458 1
d462 1
a462 3
    set result [winfo reqwidth .p]
    destroy .p .f .f2
    set result
d465 1
d477 1
d501 1
d512 1
d523 1
d756 1
d766 1
a766 1
    destroy .p .p.f .p.f2
d777 1
d791 1
d808 1
@


1.5
log
@	* tests/panedwindow.test: added panedwindow-28.[12]
	* generic/tkPanedWindow.c (PanedWindowCmdDeletedProc):
	(Tk_PanedWindowObjCmd): when destroying the panedwindow, destroy
	the proxy before the parent to avoid dependency conflicts.
	[Bug #616589]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.4 2002/08/08 01:43:44 hobbs Exp $
d2398 47
@


1.4
log
@	* tests/panedwindow.test: added -text foobar to some test buttons
	to enable correct testing of panedwindow across platforms.
	[Bug #582370]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.3 2002/07/13 20:28:35 dgp Exp $
d47 1
a47 1
	test entry-1.$i {configuration options} {
d73 1
a73 1
	test entry-1.$i {configuration options} {
d2388 11
a2398 2
    
    
@


1.3
log
@	* Converted more files to tcltest and factored out common code.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.2 2002/06/19 23:17:17 hobbs Exp $
d340 1
a340 1
    .p add [frame .f -width 20 -height 20] [button .c]
d350 1
a350 1
    .p add [frame .p.f -width 20 -height 20] [button .p.c]
d426 1
a426 1
    .p add [frame .f -width 20 -height 20] [button .c] -sticky nsew
d457 1
a457 1
    .p add [frame .f -width 20 -height 10] [button .c] -sticky nsew
@


1.2
log
@	* tests/panedwindow.test:
	* generic/tkPanedWindow.c: ensure that sash index is lower bounds
	checked. [Bug #548727]
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.1 2002/02/22 02:41:17 hobbs Exp $
d11 6
a16 15
if {[info tclversion] < 8.4} {
    puts "panedwindow requires Tk 8.4"
    exit
}

if {[lsearch [namespace children] ::tcltest] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}

foreach i [winfo children .] {
    destroy $i
}

wm geometry . {}
raise .
@


1.1
log
@TIP #41 implementation, panedwindow [Patch #512503] (melski)
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.12 2001/11/13 23:16:16 ericm Exp $
d244 21
@


1.1.4.1
log
@Adding missing files from TOT merge.
@
text
@d9 1
a9 1
# RCS: @@(#) $Id$
@


1.1.4.2
log
@Merging with TOT as of 06/09/2002.
@
text
@@


1.1.4.3
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d11 15
a25 6
package require tcltest 2.1
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
tcltest::loadTestedCommands
a243 21
test panedwindow-6.8 {sash coord subcommand, errors} {
    panedwindow .p
    set result [list \
	    [catch {.p sash coord -1} msg] $msg \
	    [catch {.p sash coord  0} msg] $msg \
	    [catch {.p sash coord  1} msg] $msg \
	    ]
    destroy .p
    set result
} [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-6.9 {sash coord subcommand, errors} {
    panedwindow .p
    .p add [frame .p.f]
    set result [list \
	    [catch {.p sash coord -1} msg] $msg \
	    [catch {.p sash coord  0} msg] \
	    [catch {.p sash coord  1} msg] $msg \
	    ]
    destroy .p
    set result
} [list 1 "invalid sash index" 0 1 "invalid sash index"]
d328 1
a328 1
    .p add [frame .f -width 20 -height 20] [button .c -text foobar]
d338 1
a338 1
    .p add [frame .p.f -width 20 -height 20] [button .p.c -text foobar]
d414 1
a414 1
    .p add [frame .f -width 20 -height 20] [button .c -text foobar] -sticky nsew
d445 1
a445 1
    .p add [frame .f -width 20 -height 10] [button .c -text foobar] -sticky nsew
@


1.1.2.1
log
@sync with head
@
text
@d9 1
a9 1
# RCS: @@(#) $Id: panedwindow.test,v 1.1 2002/02/22 02:41:17 hobbs Exp $
@

