diff options
Diffstat (limited to 'tests/panedwindow.test')
-rw-r--r-- | tests/panedwindow.test | 5693 |
1 files changed, 4223 insertions, 1470 deletions
diff --git a/tests/panedwindow.test b/tests/panedwindow.test index b075e18..ee184ce 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -6,130 +6,339 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -package require tcltest 2.1 +package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands +namespace import -force tcltest::test -set i 1 +deleteWindows +# Panedwindow for tests 1.* panedwindow .p -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 {-proxybackground - "#f0a0a0" "#f0a0a0" non-existent {unknown color name "non-existent"}} - panedwindow-1.10 {-proxyborderwidth - 1.3 1.3 badValue {bad screen distance "badValue"}} - panedwindow-1.11 {-proxyrelief - groove groove - 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.12 {-orient - horizontal horizontal - badValue {bad orient "badValue": must be horizontal or vertical}} - panedwindow-1.13 {-relief - groove groove - 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.14 {-sashcursor - arrow arrow badValue {bad cursor spec "badValue"}} - panedwindow-1.15 {-sashpad - 1.3 1 badValue {bad screen distance "badValue"}} - panedwindow-1.16 {-sashrelief - groove groove - 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.17 {-sashwidth - 10 10 badValue {bad screen distance "badValue"}} - panedwindow-1.18 {-showhandle - true 1 foo {expected boolean value but got "foo"}} - panedwindow-1.19 {-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] -} +# Buttons for tests 1.33 - 1.52 .p add [button .b] .p add [button .c] -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-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: -proxybackground (good)} -body { + .p configure -proxybackground "#f0a0a0" + list [lindex [.p configure -proxybackground] 4] [.p cget -proxybackground] +} -cleanup { + .p configure -proxybackground [lindex [.p configure -proxybackground] 3] +} -result {{#f0a0a0} #f0a0a0} +test panedwindow-1.20 {configuration options: -proxybackground (bad)} -body { + .p configure -proxybackground badValue +} -returnCodes error -result {unknown color name "badValue"} +test panedwindow-1.21 {configuration options: -proxyborderwidth (good)} -body { + .p configure -proxyborderwidth 1.3 + list [lindex [.p configure -proxyborderwidth] 4] [.p cget -proxyborderwidth] +} -cleanup { + .p configure -proxyborderwidth [lindex [.p configure -proxyborderwidth] 3] +} -result {1.3 1.3} +test panedwindow-1.22 {configuration options: -proxyborderwidth (bad)} -body { + .p configure -proxyborderwidth badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.23 {configuration options: -proxyrelief (good)} -body { + .p configure -proxyrelief groove + list [lindex [.p configure -proxyrelief] 4] [.p cget -proxyrelief] +} -cleanup { + .p configure -proxyrelief [lindex [.p configure -proxyrelief] 3] +} -result {groove groove} +test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -body { + .p configure -proxyrelief 1.5 +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test panedwindow-1.25 {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.26 {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.27 {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.28 {configuration options: -sashcursor (bad)} -body { + .p configure -sashcursor badValue +} -returnCodes error -result {bad cursor spec "badValue"} +test panedwindow-1.29 {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.30 {configuration options: -sashpad (bad)} -body { + .p configure -sashpad badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.31 {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.32 {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.33 {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.34 {configuration options: -sashwidth (bad)} -body { + .p configure -sashwidth badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.35 {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.36 {configuration options: -showhandle (bad)} -body { + .p configure -showhandle foo +} -returnCodes error -result {expected boolean value but got "foo"} +test panedwindow-1.37 {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.38 {configuration options: -width (bad)} -body { + .p configure -width badValue +} -returnCodes error -result {bad screen distance "badValue"} + +test panedwindow-1.39 {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.40 {configuration options: -after (bad)} -body { + .p paneconfigure .b -after badValue +} -returnCodes error -result {bad window path name "badValue"} +test panedwindow-1.41 {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.42 {configuration options: -before (bad)} -body { + .p paneconfigure .b -before badValue +} -returnCodes error -result {bad window path name "badValue"} +test panedwindow-1.43 {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.44 {configuration options: -height (bad)} -body { + .p paneconfigure .b -height badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.45 {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.46 {configuration options: -hide (bad)} -body { + .p paneconfigure .b -hide foo +} -returnCodes error -result {expected boolean value but got "foo"} +test panedwindow-1.47 {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.48 {configuration options: -minsize (bad)} -body { + .p paneconfigure .b -minsize badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.49 {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.50 {configuration options: -padx (bad)} -body { + .p paneconfigure .b -padx badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.51 {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.52 {configuration options: -pady (bad)} -body { + .p paneconfigure .b -pady badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.53 {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.54 {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.55 {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.56 {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.57 {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.58 {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} { +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] - destroy .p .b .c - set result -} [list [list .b .c] [list .c]] +} -cleanup { + deleteWindows +} -result [list [list .b .c] [list .c]] + -test panedwindow-4.1 {forget subcommand} { +test panedwindow-4.1 {forget subcommand} -setup { + deleteWindows +} -body { 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} { + .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] - destroy .p .b .c - set result -} [list {.b .c} .c] -test panedwindow-4.3 {forget subcommand, forget one from end} { +} -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] @@ -138,10 +347,12 @@ test panedwindow-4.3 {forget subcommand, forget one from end} { .p forget .d update lappend result [.p panes] - destroy .p .b .c .d - set result -} [list {.b .c .d} {.b .c}] -test panedwindow-4.4 {forget subcommand, forget multiple} { +} -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] @@ -150,317 +361,401 @@ test panedwindow-4.4 {forget subcommand, forget multiple} { .p forget .b .c update lappend result [.p panes] - destroy .p .b .c .d - set result -} [list {.b .c .d} .d] -test panedwindow-4.5 {forget subcommand, panes are unmapped} { +} -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] - destroy .p .b .c - - set result -} [list 1 1 0 1] -test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} { +} -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] - destroy .p .f .g - set result -} [list 44 20] +} -cleanup { + deleteWindows +} -result [list 44 20] -test panedwindow-5.1 {sash subcommand} { + +test panedwindow-5.1 {sash subcommand} -setup { + deleteWindows +} -body { 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} { + .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 - 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"] + .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} { +test panedwindow-6.1 {sash coord subcommand, errors} -setup { + deleteWindows +} -body { 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} { + .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 - 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} { + .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 - 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} { + .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] - 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} { + .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] - 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} { + .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] - 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} { + .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] - 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} { + .p sash coord 1 +} -cleanup { + deleteWindows +} -result [list 0 50] +test panedwindow-6.8 {sash coord subcommand, errors} -setup { + deleteWindows +} -body { 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} { + 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] - set result [list \ - [catch {.p sash coord -1} msg] $msg \ + 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.10 {sash coord subcommand, errors} { + [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] - set result [list \ - [catch {.p sash coord -1} msg] $msg \ + 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 \ - ] - destroy .p - set result -} [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"] + [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-8.1 {sash mark subcommand, errors} { +test panedwindow-7.1 {sash mark subcommand, errors} -setup { + deleteWindows +} -body { 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} { + .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 - 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} { + .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 - 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} { + .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] - 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} { + .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] - 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} { + .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] - set result [.p sash mark 0] - destroy .p .b .c - set result -} [list 0 0] -test panedwindow-8.7 {sash mark subcommand, set mark} { + .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 - set result [.p sash mark 0] - destroy .p .b .c - set result -} [list 10 10] + .p sash mark 0 +} -cleanup { + deleteWindows +} -result [list 10 10] -test panedwindow-9.1 {sash dragto subcommand, errors} { + +test panedwindow-8.1 {sash dragto subcommand, errors} -setup { + deleteWindows +} -body { 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} { + .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 - 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} { + .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 - 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} { + .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] - 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} { + .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] - 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\""] + .p sash dragto 0 0 bar +} -cleanup { + deleteWindows +} -returnCodes error -result {expected integer but got "bar"} -test panedwindow-10.1 {sash mark/sash dragto interaction} { + +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 - set result [.p sash coord 0] - destroy .p .f .c - set result -} [list 30 0] -test panedwindow-10.2 {sash mark/sash dragto interaction} { + .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 - 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} { + .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 - set result [.p sash coord 0] - destroy .p .f .c - set result -} [list 15 0] + .p sash coord 0 +} -cleanup { + deleteWindows +} -result [list 15 0] + -test panedwindow-11.1 {sash place subcommand, errors} { +test panedwindow-10.1 {sash place subcommand, errors} -setup { + deleteWindows +} -body { 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 + .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 - 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 + .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 - 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 + .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] - 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 + .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] - 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 + .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 -} [list 10 0] -test panedwindow-11.7 {sash place subcommand, moves sash} { - destroy .p .f .c +} -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 -} [list 0 10] -test panedwindow-11.8 {sash place subcommand, respects minsize} { - destroy .p .f .c +} -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 -} [list 15 0] -test panedwindow-11.9 {sash place subcommand, respects minsize} { - destroy .p .f .c +} -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] - list [catch {.p sash place 0 2 0} msg] $msg -} [list 1 {invalid sash index}] + .p sash place 0 2 0 +} -cleanup { + deleteWindows +} -returnCodes error -result {invalid sash index} -test panedwindow-12.1 {moving sash changes size of pane to left} { - destroy .p .f .c + +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 -} 30 -test panedwindow-12.2 {moving sash changes size of pane to right} { - destroy .p .f .f2 +} -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 @@ -469,16 +764,20 @@ test panedwindow-12.2 {moving sash changes size of pane to right} { .p sash place 0 30 0 update lappend result [winfo width .f2] -} {20 10} -test panedwindow-12.3 {moving sash does not change reqsize of panedwindow} { - destroy .p .f .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 -} 44 -test panedwindow-12.4 {moving sash changes size of pane above} { - destroy .p .f .c +} -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 @@ -486,11 +785,11 @@ test panedwindow-12.4 {moving sash changes size of pane above} { pack .p update set result [winfo height .f] - destroy .p .f .c set result -} 20 -test panedwindow-12.5 {moving sash changes size of pane below} { - destroy .p .f .f2 +} -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] @@ -500,81 +799,92 @@ test panedwindow-12.5 {moving sash changes size of pane below} { .p sash place 0 0 15 update lappend result [winfo height .f2] - destroy .p .f .f2 set result -} {10 5} -test panedwindow-12.6 {moving sash does not change reqsize of panedwindow} { +} -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] - destroy .p .f .f2 set result -} [list 24 24] -test panedwindow-12.7 {moving sash does not alter reqsize of widget} { - destroy .p .f .f2 +} -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] - destroy .p .f .f2 - set result -} [list 10 10] -test panedwindow-12.8 {moving sash restricted to minsize} { - destroy .p .f .c +} -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 - 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 + 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 - set result [winfo height .f] - destroy .p .f .c - set result -} 10 -test panedwindow-12.12 {moving sash in unmapped window restricted to reqsize} { + 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] - destroy .p .f .f2 - set result -} [list {20 0} {40 0}] -test panedwindow-12.13 {moving sash right pushes other sashes} { +} -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 - 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} { + 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 - 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} { + 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] @@ -582,11 +892,13 @@ test panedwindow-12.15 {move sash in mapped window restricted to visible win} { update .p sash place 1 100 0 update - 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} { + .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] @@ -594,12 +906,13 @@ test panedwindow-12.16 {move sash in mapped window restricted to visible win} { update .p sash place 1 200 0 update - 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} { + .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] @@ -609,36 +922,45 @@ test panedwindow-12.17 {moving sash into "virtual" space on \ .p sash place 1 200 0 update lappend result [winfo reqwidth .p] - destroy .p .f .f2 .f3 - set result -} {68 100} +} -cleanup { + deleteWindows +} -result {68 100} -test panedwindow-13.1 {horizontal panedwindow lays out widgets properly} { + +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 - set result {} 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} { + 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 - set result {} 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 2 18 2 34] -test panedwindow-13.3 {horizontal panedwindow lays out widgets properly} { + 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 "" + .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \ + -sticky "" } pack .p update @@ -648,10 +970,13 @@ test panedwindow-13.3 {horizontal panedwindow lays out widgets properly} { update lappend result [winfo reqwidth .p] [winfo reqheight .p] foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]} - 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} { + 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} { @@ -665,10 +990,13 @@ test panedwindow-13.4 {vertical panedwindow lays out widgets properly} { update lappend result [winfo reqwidth .p] [winfo reqheight .p] foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]} - 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} { + 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 @@ -677,10 +1005,12 @@ test panedwindow-13.5 {panedwindow respects reqsize of panes when possible} { .p.f configure -width 30 update lappend result [winfo width .p.f] - destroy .p .p.f - set result -} [list 20 30] -test panedwindow-13.6 {panedwindow takes explicit widget width over reqwidth} { +} -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 @@ -689,29 +1019,35 @@ test panedwindow-13.6 {panedwindow takes explicit widget width over reqwidth} { .p.f configure -width 30 update lappend result [winfo width .p.f] - destroy .p .p.f - set result -} [list 20 20] -test panedwindow-13.7 {horizontal panedwindow reqheight is max slave height} { +} -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] - destroy .p .p.f .p.f2 - set result -} {20 40} -test panedwindow-13.8 {horizontal panedwindow reqheight is max slave height} { +} -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] - destroy .p .p.f .p.f2 - set result -} {20 20} -test panedwindow-13.9 {panedwindow pane width overrides widget width} { +} -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 @@ -720,10 +1056,12 @@ test panedwindow-13.9 {panedwindow pane width overrides widget width} { set result [winfo width .p.f] .p paneconfigure .p.f -width 30 lappend result [winfo width .p.f] - destroy .p .p.f .p.f2 - set result -} [list 10 10] -test panedwindow-13.10 {panedwindow respects reqsize of panes when possible} { +} -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 @@ -732,10 +1070,12 @@ test panedwindow-13.10 {panedwindow respects reqsize of panes when possible} { .p.f configure -height 30 update lappend result [winfo height .p.f] - destroy .p .p.f - set result -} [list 20 30] -test panedwindow-13.11 {panedwindow takes explicit height over reqheight} { +} -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 @@ -744,20 +1084,24 @@ test panedwindow-13.11 {panedwindow takes explicit height over reqheight} { .p.f configure -height 30 update lappend result [winfo height .p.f] - destroy .p .p.f - set result -} [list 20 20] -test panedwindow-13.12 {vertical panedwindow reqwidth is max slave width} { +} -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] - destroy .p .p.f .p.f2 - set result -} {20 40} -test panedwindow-13.13 {vertical panedwindow reqwidth is max slave width} { +} -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]} @@ -765,11 +1109,12 @@ test panedwindow-13.13 {vertical panedwindow reqwidth is max slave width} { set result [winfo reqwidth .p] .p.f config -width 40 lappend result [winfo reqwidth .p] - destroy .p .p.f .p.f2 - set result -} {20 20} -test panedwindow-13.14 {panedwindow pane height overrides widget width} { - destroy .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]} @@ -779,32 +1124,34 @@ test panedwindow-13.14 {panedwindow pane height overrides widget width} { set result [winfo height .p.f] .p paneconfigure .p.f -height 30 lappend result [winfo height .p.f] - destroy .p - set result -} [list 10 10] +} -cleanup { + deleteWindows +} -result [list 10 10] -test panedwindow-14.1 {PanestructureProc, widget yields managements} { +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. - destroy .p .b panedwindow .p .p add [button .b] destroy .p pack .b destroy .b set result "" -} "" -test panedwindow-14.2 {PanedWindowLostSlaveProc, widget yields management} { +} -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. - destroy .p .b panedwindow .p .p add [button .b] pack .p @@ -814,56 +1161,359 @@ test panedwindow-14.2 {PanedWindowLostSlaveProc, widget yields management} { set result [.p panes] destroy .p .b set result -} {} - -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] -} - -test panedwindow-17.1 {setting minsize when pane is too small snaps width} { +} -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] - destroy .p .p.f .p.f2 - set result -} [list 20 40] +} -cleanup { + deleteWindows +} -result [list 20 40] + -test panedwindow-18.1 {MoveSash, move right} { +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 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -876,33 +1526,31 @@ test panedwindow-18.1 {MoveSash, move right} { # Check that the sash moved lappend result [.p sash coord 0] - - # Cleanup - destroy .p .f1 .f2 - - set result -} [list 42 42 {30 0}] -test panedwindow-18.2 {MoveSash, move right (unmapped) clipped by reqwidth} { +} -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 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. - 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} { + .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 + .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 @@ -913,17 +1561,16 @@ test panedwindow-18.3 {MoveSash, move right (mapped, width < reqwidth) clipped b # Get the new sash coord; it should be clipped by the visible width of # the panedwindow. - 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} { + .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 + .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 @@ -934,121 +1581,114 @@ test panedwindow-18.4 {MoveSash, move right (mapped, width > reqwidth) clipped b # Get the new sash coord; it should be clipped by the visible width of # the panedwindow. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + 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 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1061,139 +1701,132 @@ test panedwindow-18.11 {MoveSash, move left} { # Check that the sash moved lappend result [.p sash coord 0] - - # 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} { +} -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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - set result [list [.p sash coord 0] [.p sash coord 1]] - - # Cleanup - destroy .p .f1 .f2 .f3 + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result [list [list 8 0] [list 10 0]] - set result -} [list [list 8 0] [list 10 0]] -test panedwindow-19.1 {MoveSash, move down} { +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 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1206,35 +1839,33 @@ test panedwindow-19.1 {MoveSash, move down} { # Check that the sash moved lappend result [.p sash coord 0] - - # Cleanup - destroy .p .f1 .f2 - - set result -} [list 42 42 {0 30}] -test panedwindow-19.2 {MoveSash, move down (unmapped) clipped by reqheight} { +} -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 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. - 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} { + .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 + .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 @@ -1245,18 +1876,17 @@ test panedwindow-19.3 {MoveSash, move down (mapped, height < reqheight) clipped # Get the new sash coord; it should be clipped by the visible height of # the panedwindow. - 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} { + .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 + .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 @@ -1267,129 +1897,122 @@ test panedwindow-19.4 {MoveSash, move down (mapped, height > reqheight) clipped # Get the new sash coord; it should be clipped by the visible width of # the panedwindow. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + 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 + .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew } # Get the requested width of the paned window @@ -1402,178 +2025,180 @@ test panedwindow-19.11 {MoveSash, move up} { # Check that the sash moved lappend result [.p sash coord 0] - - # 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} { +} -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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - 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} { + .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 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. - set result [list [.p sash coord 0] [.p sash coord 1]] - - # Cleanup - destroy .p .f1 .f2 .f3 + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result [list [list 0 8] [list 0 10]] - set 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-20.1 {ComputeGeometry, reqheight taken from widgets} { +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] + .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]] - destroy .p .f1 .f2 .f3 - set result -} [list [list 60 20] [list 60 40]] -test panedwindow-20.2 {ComputeGeometry, reqheight taken from widgets} { +} -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] + .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]] - destroy .p .f1 .f2 .f3 - set result -} [list [list 60 20] [list 60 40]] -test panedwindow-20.3 {ComputeGeometry, reqheight taken from widgets} { +} -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 + .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]] - destroy .p .f1 .f2 .f3 - set result -} [list [list 60 60] [list 60 80]] -test panedwindow-20.4 {ComputeGeometry, reqwidth taken from widgets} { +} -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} { @@ -1582,10 +2207,13 @@ test panedwindow-20.4 {ComputeGeometry, reqwidth taken from widgets} { set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .f3 configure -width 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] - destroy .p .f1 .f2 .f3 - set result -} [list [list 20 60] [list 40 60]] -test panedwindow-20.5 {ComputeGeometry, reqwidth taken from widgets} { +} -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} { @@ -1594,10 +2222,13 @@ test panedwindow-20.5 {ComputeGeometry, reqwidth taken from widgets} { set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -width 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] - destroy .p .f1 .f2 .f3 - set result -} [list [list 20 60] [list 40 60]] -test panedwindow-20.6 {ComputeGeometry, reqwidth taken from widgets} { +} -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} { @@ -1606,219 +2237,2153 @@ test panedwindow-20.6 {ComputeGeometry, reqwidth taken from widgets} { set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]] .p paneconfigure .f3 -width 40 lappend result [list [winfo reqwidth .p] [winfo reqheight .p]] - destroy .p .f1 .f2 .f3 - set result -} [list [list 60 60] [list 80 60]] - -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 \ +} -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 "" - 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 \ + } + 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 "" - 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]] - } - } - } -} - -test panedwindow-21.1 {destroyed widgets are removed from panedwindow} { + } + 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 - set result [.p panes] - destroy .p - set result -} {} -test panedwindow-21.2 {destroyed slave causes geometry recomputation} { + .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 - set result [winfo reqwidth .p] - destroy .p .f2 - set result -} 20 + winfo reqwidth .p +} -cleanup { + deleteWindows +} -result 20 -test panedwindow-22.1 {ArrangePanes, extra space is given to the last pane} { + +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 - 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} { + 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 - set result [winfo height .f2] - destroy .p .f1 .f2 - set result -} 78 -test panedwindow-22.3 {ArrangePanes, explicit height/width are preferred} { + 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 - 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} { + 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 - 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} { + 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] \ @@ -1826,32 +4391,38 @@ test panedwindow-22.5 {ArrangePanes, panes clipped by size of pane} { .p sash place 0 0 10 pack .p update - 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} { + 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 - 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} { + 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 - 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} { + 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] @@ -1861,10 +4432,12 @@ test panedwindow-22.9 {ArrangePanes, panes with width <= 0 are unmapped} { .p sash place 0 0 0 update lappend result [winfo ismapped .f1] - destroy .p .f1 .f2 - set result -} {1 0} -test panedwindow-22.10 {ArrangePanes, panes with width <= 0 are unmapped} { +} -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] @@ -1874,10 +4447,12 @@ test panedwindow-22.10 {ArrangePanes, panes with width <= 0 are unmapped} { .p sash place 0 0 0 update lappend result [winfo ismapped .p.f1] - destroy .p .p.f1 .p.f2 - set result -} {1 0} -test panedwindow-22.11 {ArrangePanes, panes with width <= 0 are unmapped} { +} -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] @@ -1887,32 +4462,37 @@ test panedwindow-22.11 {ArrangePanes, panes with width <= 0 are unmapped} { .p sash place 0 0 0 update lappend result [winfo ismapped .p.f1] - destroy .p .p.f1 .p.f2 - set result -} {1 0} -test panedwindow-22.12 {ArrangePanes, last pane shrinks} { +} -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 - set result [winfo width .f2] - destroy .p .f1 .f2 - set result -} 18 -test panedwindow-22.13 {ArrangePanes, last pane shrinks} { + 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 - set result [winfo height .f2] - destroy .p .f1 .f2 - set result -} 18 -test panedwindow-22.14 {ArrangePanes, panedwindow resizes} { - -body { + 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] @@ -1920,12 +4500,12 @@ test panedwindow-22.14 {ArrangePanes, panedwindow resizes} { .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 { +} -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] @@ -1933,12 +4513,12 @@ test panedwindow-22.15 {ArrangePanes, panedwindow resizes} { .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 { +} -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] @@ -1952,13 +4532,14 @@ test panedwindow-22.16 {ArrangePanes, last pane grows} { 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 211 50 150 1 89 300} -} +} -cleanup { + deleteWindows +} -result {50 150 1 1 211 50 150 1 89 300} -test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} { +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] \ @@ -1966,10 +4547,12 @@ test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} { set result [winfo reqheight .p] .f1 configure -height 80 lappend result [winfo reqheight .p] - destroy .p .f1 .f2 - set result -} {40 80} -test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} { +} -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] @@ -1977,111 +4560,139 @@ test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} { lappend result [winfo reqwidth .p] destroy .p .f1 .f2 expr {[lindex $result 1] - [lindex $result 0]} -} {10} +} -cleanup { + deleteWindows +} -result {10} -test panedwindow-24.1 {ConfigurePanes, can't add panedwindow to itself} { +test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup { + deleteWindows +} -body { 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} { + .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 - 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} { + .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} - set result [.p panes] - destroy .p .b - set result -} {} -test panedwindow-24.4 {ConfigurePanes, bad option aborts processing} { + .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} - set result [.p panes] - destroy .p .b - set result -} {} -test panedwindow-24.5 {ConfigurePanes, after win isn't managed by panedwin} { + .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 - 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} { + .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 - 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} { + .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 {} - set result [.p panes] - destroy .p .b .c - set result -} {.b .c} -test panedwindow-24.8 {ConfigurePanes, -before {} is a no-op} { + .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 {} - set result [.p panes] - destroy .p .b .c - set result -} {.b .c} -test panedwindow-24.9 {ConfigurePanes, new panes are added} { + .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] - set result [.p panes] - destroy .p .b .c - set result -} {.b .c} -test panedwindow-24.10 {ConfigurePanes, options applied to all panes} { + .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 + 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} { + 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 - 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} { + 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] - set result [.p panes] - destroy .p .b .c .d - set result -} {.b .c .d} -test panedwindow-24.13 {ConfigurePanes, -after, single addition} { + .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 @@ -2089,11 +4700,13 @@ test panedwindow-24.13 {ConfigurePanes, -after, single addition} { .p add .a .b .p add .c -after .a - set result [.p panes] - destroy .p .a .b .c - set result -} {.a .c .b} -test panedwindow-24.14 {ConfigurePanes, -after, multiple additions} { + .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 @@ -2102,11 +4715,13 @@ test panedwindow-24.14 {ConfigurePanes, -after, multiple additions} { .p add .a .b .p add .c .d -after .a - 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} { + .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 @@ -2115,11 +4730,13 @@ test panedwindow-24.15 {ConfigurePanes, -after, relocates existing widget} { .p add .a .b .c .d .p add .d -after .a - 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} { + .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 @@ -2128,11 +4745,13 @@ test panedwindow-24.16 {ConfigurePanes, -after, relocates existing widgets} { .p add .a .b .c .d .p add .b .d -after .a - 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} { + .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 @@ -2141,11 +4760,13 @@ test panedwindow-24.17 {ConfigurePanes, -after, relocates existing widgets} { .p add .a .b .c .d .p add .d .a -after .b - 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} { + .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 @@ -2154,11 +4775,13 @@ test panedwindow-24.18 {ConfigurePanes, -after, relocates existing widgets} { .p add .a .b .c .d .p add .d .a -after .a - 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} { + .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 @@ -2167,11 +4790,13 @@ test panedwindow-24.19 {ConfigurePanes, -after, after last window} { .p add .a .b .c .p add .d -after .c - 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} { + .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 @@ -2180,11 +4805,13 @@ test panedwindow-24.20 {ConfigurePanes, -before, before first window} { .p add .a .b .c .p add .d -before .a - 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} { + .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 @@ -2193,11 +4820,13 @@ test panedwindow-24.21 {ConfigurePanes, -before, relocate existing windows} { .p add .a .b .c .p add .d .b -before .a - 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} { + .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 @@ -2206,11 +4835,13 @@ test panedwindow-24.22 {ConfigurePanes, slave specified multiple times} { button .c .p add .a .a .b .c - set result [.p panes] - destroy .p .a .b .c - set result -} {.a .b .c} -test panedwindow-24.23 {ConfigurePanes, slave specified multiple times} { + .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 @@ -2220,52 +4851,63 @@ test panedwindow-24.23 {ConfigurePanes, slave specified multiple times} { .p add .a .a .b .c .p add .a .b .a -after .c - set result [.p panes] - destroy .p .a .b .c - set result -} {.c .a .b} -test panedwindow-24.24 {ConfigurePanes, panedwindow cannot manage toplevels} { + .p panes +} -cleanup { + deleteWindows +} -result {.c .a .b} +test panedwindow-23.24 {ConfigurePanes, panedwindow cannot manage toplevels} -setup { + deleteWindows +} -body { panedwindow .p toplevel .t - 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} { + .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 - 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} { + .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 - 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} { + .f.p add .b +} -cleanup { + deleteWindows +} -result {} +test panedwindow-23.27 {ConfigurePanes, restrict possible panes} -setup { + deleteWindows +} -body { panedwindow .p button .p.b - 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} { + .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 - 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 { + .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 @@ -2285,12 +4927,12 @@ test panedwindow-24.29.1 {ConfigurePanes, -hide works} { [winfo ismapped .f3] [winfo ismapped .f4] 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 {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 { +} -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 @@ -2310,12 +4952,44 @@ test panedwindow-24.29.2 {ConfigurePanes, -hide works} { [winfo ismapped .f3] [winfo ismapped .f4] 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 {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 { +} -cleanup { + deleteWindows +} -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130} +test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup { + deleteWindows +} -body { + panedwindow .p1 -sashrelief raised + panedwindow .p2 -sashrelief raised + label .l1 -text Label1 + label .l2 -text Label2 + label .l3 -text Label3 + .p2 add .l2 -sticky nsew + .p2 add .l3 -sticky nsew + .p1 add .p2 -sticky nsew + .p1 add .l1 -sticky nsew + pack .p1 -side top -expand 1 -fill both + update + set result [list] + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p2 paneconfigure .l1 -hide 1 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p1 paneconfigure .p2 -hide 1 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p1 paneconfigure .p2 -hide 0 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] +} -cleanup { + deleteWindows +} -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}} +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 @@ -2327,13 +5001,13 @@ test panedwindow-24.29.3 {ConfigurePanes, -hide works, last pane stretches} { 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 {destroy .p .f1 .f2 .f3} - -result {50 50 94 50 50 147} -} -test panedwindow-24.29.4 {ConfigurePanes, -hide works, last pane stretches} { - -body { + 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 @@ -2347,13 +5021,13 @@ test panedwindow-24.29.4 {ConfigurePanes, -hide works, last pane stretches} { .p paneconfigure .f2 -hide 1 update lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3] - } - -cleanup {destroy .p .f1 .f2 .f3} - -result {50 50 94 50 50 147} -} +} -cleanup { + deleteWindows +} -result {50 50 94 50 50 147} -test panedwindow-24.30 {ConfigurePanes, -stretch first} { - -body { +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 @@ -2369,12 +5043,12 @@ test panedwindow-24.30 {ConfigurePanes, -stretch first} { update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] - } - -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {51 40 40 40 94 40 40 40} -} -test panedwindow-24.31 {ConfigurePanes, -stretch middle} { - -body { +} -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 @@ -2390,12 +5064,12 @@ test panedwindow-24.31 {ConfigurePanes, -stretch middle} { update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] - } - -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {40 45 46 40 40 45 94 40} -} -test panedwindow-24.32 {ConfigurePanes, -stretch always} { - -body { +} -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 @@ -2411,12 +5085,12 @@ test panedwindow-24.32 {ConfigurePanes, -stretch always} { update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] - } - -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {42 43 43 43 58 43 58 58} -} -test panedwindow-24.33 {ConfigurePanes, -stretch never} { - -body { +} -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 @@ -2432,12 +5106,14 @@ test panedwindow-24.33 {ConfigurePanes, -stretch never} { update lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \ [winfo width .f4] - } - -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {40 40 40 40 40 40 40 40} -} +} -cleanup { + deleteWindows +} -result {40 40 40 40 40 40 40 40} + -test panedwindow-25.1 {Unlink, remove a paned with -before/-after refs} { +test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup { + deleteWindows +} -body { # Bug 928413 set result {} panedwindow .pw @@ -2452,22 +5128,27 @@ test panedwindow-25.1 {Unlink, remove a paned with -before/-after refs} { 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} +} -cleanup { + deleteWindows +} -result {.pw.l3 {} .pw.l1} + -test panedwindow-26.1 {DestroyPanedWindow} { +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] + .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 + destroy $w } set result {} -} {} -test panedwindow-26.2 {UnmapNotify and MapNotify events are propagated to slaves} { +} -result {} +test panedwindow-25.2 {UnmapNotify and MapNotify events are propagated to slaves} -setup { + deleteWindows +} -body { panedwindow .pw .pw add [button .pw.b] pack .pw @@ -2483,301 +5164,371 @@ test panedwindow-26.2 {UnmapNotify and MapNotify events are propagated to slaves lappend result [winfo ismapped .pw.b] destroy .pw .pw.b set result -} {1 0 0 1 1} +} -cleanup { + deleteWindows +} -result {1 0 0 1 1} + -test panedwindow-27.1 {PanedWindowIdentifyCoords} { +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] - set result [.p identify 0 0] - destroy .p .f .f2 - set result -} {} -test panedwindow-27.2 {PanedWindowIdentifyCoords, padding is included} { + .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] - set result [.p identify 20 0] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.3 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 22 0] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.4 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 24 0] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.5 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 26 0] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.6 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 26 -1] - destroy .p .f .f2 - set result -} {} -test panedwindow-27.7 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 26 100] - destroy .p .f .f2 - set result -} {} -test panedwindow-27.8 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 22 4] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.9 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 22 5] - destroy .p .f .f2 - set result -} {0 handle} -test panedwindow-27.10 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 20 5] - destroy .p .f .f2 - set result -} {0 handle} -test panedwindow-27.11 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 20 0] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.12 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 48 0] - destroy .p .f .f2 .f3 - set result -} {1 sash} -test panedwindow-27.13 {identify subcommand errors} { + .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 - 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} { + .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 - 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} { + .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 - 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} { + .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] - set result [.p identify 0 0] - destroy .p .f .f2 - set result -} {} -test panedwindow-27.16 {PanedWindowIdentifyCoords, padding is included} { + .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] - set result [.p identify 0 20] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.17 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 0 22] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.18 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 0 24] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.19 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 0 26] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.20 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify -1 26] - destroy .p .f .f2 - set result -} {} -test panedwindow-27.21 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 100 26] - destroy .p .f .f2 - set result -} {} -test panedwindow-27.22 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 4 22] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.23 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 5 22] - destroy .p .f .f2 - set result -} {0 handle} -test panedwindow-27.24 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 5 20] - destroy .p .f .f2 - set result -} {0 handle} -test panedwindow-27.25 {PanedWindowIdentifyCoords} { + .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] - set result [.p identify 0 20] - destroy .p .f .f2 - set result -} {0 sash} -test panedwindow-27.26 {PanedWindowIdentifyCoords} { + .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] - 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]} { + .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 -} {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 { +} -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 {destroy .t} - -result {} -} -test panedwindow-30.2 {display on depths other than the default one} { - -constraints {pseudocolor8 haveTruecolor24} - -body { +} -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] @@ -2788,11 +5539,13 @@ test panedwindow-30.2 {display on depths other than the default one} { .t.f.p proxy forget update # If we got here, we didn't crash and that's good - } - -cleanup {destroy .t} - -result {} -} +} -cleanup { + deleteWindows +} -result {} + # cleanup cleanupTests return + + |