diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | tests/menuDraw.test | 759 | ||||
-rw-r--r-- | tests/msgbox.test | 468 | ||||
-rw-r--r-- | tests/oldpack.test | 579 | ||||
-rw-r--r-- | tests/pack.test | 1799 | ||||
-rw-r--r-- | tests/panedwindow.test | 5621 |
6 files changed, 6488 insertions, 2746 deletions
@@ -1,3 +1,11 @@ +2008-08-18 Ania Pawelczyk <aniap@users.sourceforge.net> + + * tests/menuDraw.test: Update to tcltest2 + * tests/msgbox.test: + * tests/oldpack.test: + * tests/ pack.test: + * tests/panedwindow.test: + 2008-08-21 Donal K. Fellows <dkf@users.sf.net> * generic/tkOption.c (ExtendArray): Rework so that the code uses diff --git a/tests/menuDraw.test b/tests/menuDraw.test index 0e47a62..406925a 100644 --- a/tests/menuDraw.test +++ b/tests/menuDraw.test @@ -5,175 +5,261 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: menuDraw.test,v 1.10 2007/05/09 12:52:44 das Exp $ +# RCS: @(#) $Id: menuDraw.test,v 1.11 2008/08/21 11:19:33 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands +namespace import -force tcltest::test -test menuDraw-1.1 {TkMenuInitializeDrawingFields} { - catch {destroy .m1} - list [menu .m1] [destroy .m1] -} {.m1 {}} - -test menuDraw-2.1 {TkIntializeMenuEntryDrawingFields} { - catch {destroy .m1} +test menuDraw-1.1 {TkMenuInitializeDrawingFields} -setup { + deleteWindows +} -body { menu .m1 - list [.m1 add command] [destroy .m1] -} {{} {}} +} -cleanup { + deleteWindows +} -result {.m1} + + +test menuDraw-2.1 {TkIntializeMenuEntryDrawingFields} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command +} -cleanup { + deleteWindows +} -result {} + -test menuDraw-3.1 {TkMenuFreeDrawOptions} { - catch {destroy .m1} +test menuDraw-3.1 {TkMenuFreeDrawOptions} -setup { + deleteWindows +} -body { menu .m1 - list [destroy .m1] -} {{}} + destroy .m1 +} -result {} -test menuDraw-4.1 {TkMenuEntryFreeDrawOptions} { - catch {destroy .m1} + +test menuDraw-4.1 {TkMenuEntryFreeDrawOptions} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "This is a test" - list [destroy .m1] -} {{}} -test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label "This is a test." -font "Courier 12" -activeforeground red -background green -selectcolor purple - list [destroy .m1] -} {{}} - -test menuDraw-5.1 {TkMenuConfigureDrawOptions - new menu} { - catch {destroy .m1} - list [menu .m1] [destroy .m1] -} {.m1 {}} -test menuDraw-5.2 {TkMenuConfigureDrawOptions - old menu} { - catch {destroy .m1} - menu .m1 - list [.m1 configure -fg red] [destroy .m1] -} {{} {}} -test menuDraw-5.3 {TkMenuConfigureDrawOptions - no disabledFg} { - catch {destroy .m1} - list [menu .m1 -disabledforeground ""] [destroy .m1] -} {.m1 {}} - -test menuDraw-6.1 {TkMenuConfigureEntryDrawOptions - no tkfont specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add command -label "foo"] [destroy .m1] -} {{} {}} -test menuDraw-6.2 {TkMenuConfigureEntryDrawOptions - tkfont specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add command -label "foo" -font "Courier 12"] [destroy .m1] -} {{} {}} -test menuDraw-6.3 {TkMenuConfigureEntryDrawOptions - active state - wrong entry} { - catch {destroy .m1} + destroy .m1 +} -result {} +test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add checkbutton -label "This is a test." -font "Courier 12" \ + -activeforeground red -background green -selectcolor purple + destroy .m1 +} -result {} + + +test menuDraw-5.1 {TkMenuConfigureDrawOptions - new menu} -setup { + deleteWindows +} -body { + menu .m1 +} -cleanup { + deleteWindows +} -result {.m1} +test menuDraw-5.2 {TkMenuConfigureDrawOptions - old menu} -setup { + deleteWindows +} -body { + menu .m1 + .m1 configure -fg red +} -cleanup { + deleteWindows +} -result {} +test menuDraw-5.3 {TkMenuConfigureDrawOptions - no disabledFg} -setup { + deleteWindows +} -body { + menu .m1 -disabledforeground "" +} -cleanup { + deleteWindows +} -result {.m1} + + +test menuDraw-6.1 {TkMenuConfigureEntryDrawOptions - no tkfont specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "foo" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.2 {TkMenuConfigureEntryDrawOptions - tkfont specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "foo" -font "Courier 12" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.3 {TkMenuConfigureEntryDrawOptions - active state - wrong entry} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" - list [.m1 entryconfigure 1 -state active] [destroy .m1] -} {{} {}} -test menuDraw-6.4 {TkMenuConfigureEntryDrawOptions - active state - correct entry} { - catch {destroy .m1} + .m1 entryconfigure 1 -state active +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.4 {TkMenuConfigureEntryDrawOptions - active state - correct entry} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" .m1 activate 1 - list [.m1 entryconfigure 1 -state active] [destroy .m1] -} {{} {}} -test menuDraw-6.5 {TkMenuConfigureEntryDrawOptions - deactivate entry} { - catch {destroy .m1} + .m1 entryconfigure 1 -state active +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.5 {TkMenuConfigureEntryDrawOptions - deactivate entry} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" .m1 activate 1 - list [.m1 entryconfigure 1 -state normal] [destroy .m1] -} {{} {}} -test menuDraw-6.6 {TkMenuConfigureEntryDrawOptions - bad state} { - catch {destroy .m1} + .m1 entryconfigure 1 -state normal +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.6 {TkMenuConfigureEntryDrawOptions - bad state} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" - list [catch {.m1 entryconfigure 1 -state foo} msg] $msg [destroy .m1] -} {1 {bad state "foo": must be active, normal, or disabled} {}} -test menuDraw-6.7 {TkMenuConfigureEntryDrawOptions - tkfont specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add command -label "foo" -font "Courier 12"] [destroy .m1] -} {{} {}} -test menuDraw-6.8 {TkMenuConfigureEntryDrawOptions - border specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add command -label "foo" -background "red"] [destroy .m1] -} {{} {}} -test menuDraw-6.9 {TkMenuConfigureEntryDrawOptions - foreground specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add command -label "foo" -foreground "red"] [destroy .m1] -} {{} {}} -test menuDraw-6.10 {TkMenuConfigureEntryDrawOptions - activeBorder specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add command -label "foo" -activebackground "red"] [destroy .m1] -} {{} {}} -test menuDraw-6.11 {TkMenuConfigureEntryDrawOptions - activeforeground specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add command -label "foo" -activeforeground "red"] [destroy .m1] -} {{} {}} -test menuDraw-6.12 {TkMenuConfigureEntryDrawOptions - selectcolor specified} { - catch {destroy .m1} - menu .m1 - list [.m1 add radiobutton -label "foo" -selectcolor "red"] [destroy .m1] -} {{} {}} -test menuDraw-6.13 {TkMenuConfigureEntryDrawOptions - textGC disposal} { - catch {destroy .m1} + .m1 entryconfigure 1 -state foo +} -cleanup { + deleteWindows +} -returnCodes error -result {bad state "foo": must be active, normal, or disabled} +test menuDraw-6.7 {TkMenuConfigureEntryDrawOptions - tkfont specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "foo" -font "Courier 12" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.8 {TkMenuConfigureEntryDrawOptions - border specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "foo" -background "red" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.9 {TkMenuConfigureEntryDrawOptions - foreground specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "foo" -foreground "red" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.10 {TkMenuConfigureEntryDrawOptions - activeBorder specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "foo" -activebackground "red" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.11 {TkMenuConfigureEntryDrawOptions - activeforeground specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "foo" -activeforeground "red" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.12 {TkMenuConfigureEntryDrawOptions - selectcolor specified} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add radiobutton -label "foo" -selectcolor "red" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.13 {TkMenuConfigureEntryDrawOptions - textGC disposal} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" -font "Helvetica 12" - list [.m1 entryconfigure 1 -font "Courier 12"] [destroy .m1] -} {{} {}} -test menuDraw-6.14 {TkMenuConfigureEntryDrawOptions - activeGC disposal} { - catch {destroy .m1} + .m1 entryconfigure 1 -font "Courier 12" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.14 {TkMenuConfigureEntryDrawOptions - activeGC disposal} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" -activeforeground "red" - list [.m1 entryconfigure 1 -activeforeground "green"] [destroy .m1] -} {{} {}} -test menuDraw-6.15 {TkMenuConfigureEntryDrawOptions - disabledGC disposal} { - catch {destroy .m1} + .m1 entryconfigure 1 -activeforeground "green" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.15 {TkMenuConfigureEntryDrawOptions - disabledGC disposal} -setup { + deleteWindows +} -body { menu .m1 -disabledforeground "red" .m1 add command -label "foo" - list [.m1 configure -disabledforeground "green"] [destroy .m1] -} {{} {}} -test menuDraw-6.16 {TkMenuConfigureEntryDrawOptions - indicatorGC disposal} { - catch {destroy .m1} + .m1 configure -disabledforeground "green" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-6.16 {TkMenuConfigureEntryDrawOptions - indicatorGC disposal} -setup { + deleteWindows +} -body { menu .m1 .m1 add radiobutton -label "foo" -selectcolor "red" - list [.m1 entryconfigure 1 -selectcolor "green"] [destroy .m1] -} {{} {}} + .m1 entryconfigure 1 -selectcolor "green" +} -cleanup { + deleteWindows +} -result {} + -test menuDraw-7.1 {TkEventuallyRecomputeMenu} { - catch {destroy .m1} +test menuDraw-7.1 {TkEventuallyRecomputeMenu} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "This is a long label" set tearoff [tk::TearOffMenu .m1] update idletasks - list [.m1 entryconfigure 1 -label "foo"] [destroy .m1] -} {{} {}} -test menuDraw-7.2 {TkEventuallyRecomputeMenu - update pending} { - catch {destroy .m1} + .m1 entryconfigure 1 -label "foo" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-7.2 {TkEventuallyRecomputeMenu - update pending} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "This is a long label" set tearoff [tk::TearOffMenu .m1] - list [.m1 entryconfigure 1 -label "foo"] [destroy .m1] -} {{} {}} + .m1 entryconfigure 1 -label "foo" +} -cleanup { + deleteWindows +} -result {} -test menuDraw-8.1 {TkRecomputeMenu} {win userInteraction} { - catch {destroy .m1} +test menuDraw-8.1 {TkRecomputeMenu} -constraints { + win userInteraction +} -setup { + deleteWindows +} -body { menu .m1 .m1 configure -postcommand [.m1 add command -label foo] .m1 add command -label "Hit ESCAPE to make this menu go away." - list [.m1 post 0 0] [destroy .m1] -} {{} {}} + .m1 post 0 0 +} -cleanup { + deleteWindows +} -result {} -test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} { - catch {destroy .m1} +test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} -setup { + deleteWindows +} -body { catch {unset foo} menu .m1 set foo 0 @@ -181,46 +267,66 @@ test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} { tk::TearOffMenu .m1 update idletasks list [set foo test] [destroy .m1] [unset foo] -} {test {} {}} -test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} { - catch {destroy .m1} +} -result {test {} {}} +test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} -setup { + deleteWindows +} -body { menu .m1 - list [catch {tk::TearOffMenu .m1}] [destroy .m1] -} {0 {}} + tk::TearOffMenu .m1 +} -cleanup { + deleteWindows +} -returnCodes ok -match glob -result * + # Don't know how to test when window has been deleted and ComputeMenuGeometry # gets called. -test menuDraw-10.1 {ComputeMenuGeometry - menubar} { - catch {destroy .m1} +test menuDraw-10.1 {ComputeMenuGeometry - menubar} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label test . configure -menu .m1 - list [update idletasks] [. configure -menu ""] [destroy .m1] -} {{} {} {}} -test menuDraw-10.2 {ComputeMenuGeometry - non-menubar} { - catch {destroy .m1} + list [update idletasks] [. configure -menu ""] +} -cleanup { + deleteWindows +} -result {{} {}} +test menuDraw-10.2 {ComputeMenuGeometry - non-menubar} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label test - list [update idletasks] [destroy .m1] -} {{} {}} -test menuDraw-10.3 {ComputeMenuGeometry - Resize necessary} { - catch {destroy .m1} + update idletasks +} -cleanup { + deleteWindows +} -result {} +test menuDraw-10.3 {ComputeMenuGeometry - Resize necessary} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label test - list [update idletasks] [destroy .m1] -} {{} {}} -test menuDraw-10.4 {ComputeMenuGeometry - resize not necessary} { - catch {destroy .m1} + update idletasks +} -cleanup { + deleteWindows +} -result {} +test menuDraw-10.4 {ComputeMenuGeometry - resize not necessary} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label test update idletasks .m1 entryconfigure 1 -label test - list [update idletasks] [destroy .m1] -} {{} {}} + update idletasks +} -cleanup { + deleteWindows +} -result {} -test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} testImageType { - catch {destroy .m1} - catch {eval image delete [image names]} + +test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} -constraints { + testImageType +} -setup { + deleteWindows + eval image delete [image names] +} -body { image create test image1 image create test image2 menu .m1 @@ -229,10 +335,13 @@ test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} set tearoff [tk::TearOffMenu .m1 40 40] update idletasks list [image delete image2] [destroy .m1] [eval image delete [image names]] -} {{} {} {}} -test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} testImageType { - catch {destroy .m1} +} -result {{} {} {}} +test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} -constraints { + testImageType +} -setup { + deleteWindows catch {eval image delete [image names]} +} -body { image create test image1 image create test image2 menu .m1 @@ -240,10 +349,13 @@ test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} test .m1 invoke 1 set tearoff [tk::TearOffMenu .m1 40 40] list [image delete image2] [destroy .m1] [eval image delete [image names]] -} {{} {} {}} -test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} testImageType { - catch {destroy .m1} +} -result {{} {} {}} +test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} -constraints { + testImageType +} -setup { + deleteWindows catch {eval image delete [image names]} +} -body { image create test image1 image create test image2 menu .m1 @@ -251,57 +363,76 @@ test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} testImageType { set tearoff [tk::TearOffMenu .m1 40 40] update idletasks list [image delete image2] [destroy .m1] [eval image delete [image names]] -} {{} {} {}} +} -result {{} {} {}} #Don't know how to test missing tkwin in DisplayMenu -test menuDraw-12.1 {DisplayMenu - menubar background} unix { - catch {destroy .m1} +test menuDraw-12.1 {DisplayMenu - menubar background} -constraints unix -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label foo -menu .m2 . configure -menu .m1 - list [update] [. configure -menu ""] [destroy .m1] -} {{} {} {}} -test menuDraw-12.2 {Display menu - no entries} { - catch {destroy .m1} + list [update] [. configure -menu ""] +} -cleanup { + deleteWindows +} -result {{} {}} +test menuDraw-12.2 {Display menu - no entries} -setup { + deleteWindows +} -body { menu .m1 set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test menuDraw-12.3 {DisplayMenu - one entry} { - catch {destroy .m1} + update +} -cleanup { + deleteWindows +} -result {} +test menuDraw-12.3 {DisplayMenu - one entry} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label foo set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test menuDraw-12.4 {DisplayMenu - two entries} { - catch {destroy .m1} + update +} -cleanup { + deleteWindows +} -result {} +test menuDraw-12.4 {DisplayMenu - two entries} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "one" .m1 add command -label "two" set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test menuDraw.12.5 {DisplayMenu - two columns - first bigger} { - catch {destroy .m1} + update +} -cleanup { + deleteWindows +} -result {} +test menuDraw.12.5 {DisplayMenu - two columns - first bigger} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "one" .m1 add command -label "two" .m1 add command -label "three" -columnbreak 1 set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test menuDraw-12.5 {DisplayMenu - two column - second bigger} { - catch {destroy .m1} + update +} -cleanup { + deleteWindows +} -result {} +test menuDraw-12.5 {DisplayMenu - two column - second bigger} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "one" .m1 add command -label "two" -columnbreak 1 .m1 add command -label "three" set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test menuDraw.12.7 {DisplayMenu - three columns} { - catch {destroy .m1} + update +} -cleanup { + deleteWindows +} -result {} +test menuDraw.12.7 {DisplayMenu - three columns} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "one" .m1 add command -label "two" -columnbreak 1 @@ -310,133 +441,175 @@ test menuDraw.12.7 {DisplayMenu - three columns} { .m1 add command -label "five" .m1 add command -label "six" set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test menuDraw-12.6 {Display menu - testing for extra space and menubars} unix { - catch {destroy .m1} + update +} -cleanup { + deleteWindows +} -result {} +test menuDraw-12.6 {Display menu - testing for extra space and menubars} -constraints { + unix +} -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label foo . configure -menu .m1 - list [update] [. configure -menu ""] [destroy .m1] -} {{} {} {}} -test menuDraw-12.7 {Display menu - extra space at end of menu} { - catch {destroy .m1} + update + . configure -menu "" +} -cleanup { + deleteWindows +} -result {} +test menuDraw-12.7 {Display menu - extra space at end of menu} -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label foo set tearoff [tk::TearOffMenu .m1 40 40] wm geometry $tearoff 200x100 - list [update] [destroy .m1] -} {{} {}} + update +} -cleanup { + deleteWindows +} -result {} + -test menuDraw-13.1 {TkMenuEventProc - Expose} { - catch {destroy .m1} - catch {destroy .m2} +test menuDraw-13.1 {TkMenuEventProc - Expose} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "one" menu .m2 .m2 add command -label "two" set tearoff1 [tk::TearOffMenu .m1 40 40] set tearoff2 [tk::TearOffMenu .m2 40 40] - list [raise $tearoff2] [update] [destroy .m1] [destroy .m2] -} {{} {} {} {}} -test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} { - catch {destroy .m1} + list [raise $tearoff2] [update] +} -cleanup { + deleteWindows +} -result {{} {}} +test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" set tearoff [tk::TearOffMenu .m1 40 40] - list [wm geometry $tearoff 200x100] [update] [destroy .m1] -} {{} {} {}} + list [wm geometry $tearoff 200x100] [update] +} -cleanup { + deleteWindows +} -result {{} {}} # Testing deletes is hard, and I am going to do my best. Don't know how # to test the case where we have already cleared the tkwin field in the # menuPtr. -test menuDraw-13.4 {TkMenuEventProc - simple delete} { - catch {destroy .m1} +test menuDraw-13.4 {TkMenuEventProc - simple delete} -setup { + deleteWindows +} -body { menu .m1 - list [destroy .m1] -} {{}} -test menuDraw-13.5 {TkMenuEventProc - nothing pending} { - catch {destroy .m1} + destroy .m1 +} -result {} +test menuDraw-13.5 {TkMenuEventProc - nothing pending} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label foo update idletasks - list [destroy .m1] -} {{}} + destroy .m1 +} -result {} -test menuDraw-14.1 {TkMenuImageProc} testImageType { - catch {destroy .m1} + +test menuDraw-14.1 {TkMenuImageProc} -constraints testImageType -setup { + deleteWindows +} -body { catch {image delete image1} menu .m1 image create test image1 .m1 add command -image image1 update idletasks - list [image delete image1] [destroy .m1] -} {{} {}} -test menuDraw-14.2 {TkMenuImageProc} testImageType { - catch {destroy .m1} + image delete image1 +} -cleanup { + deleteWindows +} -result {} +test menuDraw-14.2 {TkMenuImageProc} -constraints testImageType -setup { + deleteWindows +} -body { catch {image delete image1} menu .m1 image create test image1 .m1 add command -image image1 - list [image delete image1] [destroy .m1] -} {{} {}} + image delete image1 +} -cleanup { + deleteWindows +} -result {} + -test menuDraw-15.1 {TkPostTearoffMenu - Basic posting} { - catch {destroy .m1} +test menuDraw-15.1 {TkPostTearoffMenu - Basic posting} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} { - catch {destroy .m1} + tk::TearOffMenu .m1 40 40 +} -cleanup { + deleteWindows +} -returnCodes ok -match glob -result * +test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" -state active set tearoff [tk::TearOffMenu .m1 40 40] - list [$tearoff index active] [destroy .m1] -} {none {}} -test menuDraw-15.3 {TkPostTearoffMenu - post command} { - catch {destroy .m1} + $tearoff index active +} -cleanup { + deleteWindows +} -result {none} +test menuDraw-15.3 {TkPostTearoffMenu - post command} -setup { + deleteWindows +} -body { catch {unset foo} menu .m1 -postcommand "set foo .m1" .m1 add command -label "foo" list [catch {tk::TearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1] -} {0 .m1 {} {}} -test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} { - catch {destroy .m1} +} -result {0 .m1 {} {}} +test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} -setup { + deleteWindows +} -body { menu .m1 -postcommand "destroy .m1" .m1 add command -label "foo" list [catch {tk::TearOffMenu .m1 40 40} msg] $msg [winfo exists .m1] -} {0 {} 0} -test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} { - catch {destroy .m1} +} -result {0 {} 0} +test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" set height [winfo screenheight .m1] - list [catch {tk::TearOffMenu .m1 40 $height}] [destroy .m1] -} {0 {}} -test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} { - catch {destroy .m1} + tk::TearOffMenu .m1 40 $height +} -cleanup { + deleteWindows +} -returnCodes ok -match glob -result * +test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} -setup { + deleteWindows +} -body { menu .m1 .m1 add command -label "foo" set width [winfo screenwidth .m1] - list [catch {tk::TearOffMenu .m1 $width 40}] [destroy .m1] -} {0 {}} + tk::TearOffMenu .m1 $width 40 +} -cleanup { + deleteWindows +} -returnCodes ok -match glob -result * -test menuDraw-16.1 {TkPostSubmenu} nonUnixUserInteraction { - catch {destroy .m1} - catch {destroy .m2} +test menuDraw-16.1 {TkPostSubmenu} -constraints nonUnixUserInteraction -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to make this menu go away." set tearoff [tk::TearOffMenu .m1 40 40] $tearoff postcascade 0 - list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] -} {{} {} {}} -test menuDraw-16.2 {TkPostSubMenu} nonUnixUserInteraction { - catch {destroy .m1} - catch {destroy .m2} - catch {destroy .m3} + $tearoff postcascade 0 +} -cleanup { + deleteWindows +} -result {} +test menuDraw-16.2 {TkPostSubMenu} -constraints nonUnixUserInteraction -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label "two" -menu .m2 .m1 add cascade -label "three" -menu .m3 @@ -446,68 +619,90 @@ test menuDraw-16.2 {TkPostSubMenu} nonUnixUserInteraction { .m3 add command -label "three" set tearoff [tk::TearOffMenu .m1 40 40] $tearoff postcascade 0 - list [$tearoff postcascade 1] [destroy .m1] [destroy .m2] [destroy .m3] -} {{} {} {} {}} -test menuDraw-16.3 {TkPostSubMenu} { - catch {destroy .m1} + $tearoff postcascade 1 +} -cleanup { + deleteWindows +} -result {} +test menuDraw-16.3 {TkPostSubMenu} -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label test -menu .m2 - list [.m1 postcascade 1] [destroy .m1] -} {{} {}} -test menuDraw-16.4 {TkPostSubMenu} { - catch {destroy .m1} + .m1 postcascade 1 +} -cleanup { + deleteWindows +} -result {} +test menuDraw-16.4 {TkPostSubMenu} -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label test set tearoff [tk::TearOffMenu .m1 40 40] - list [$tearoff postcascade 0] [destroy .m1] -} {{} {}} -test menuDraw-16.5 {TkPostSubMenu} unix { - catch {destroy .m1} - catch {destroy .m2} + $tearoff postcascade 0 +} -cleanup { + deleteWindows +} -result {} +test menuDraw-16.5 {TkPostSubMenu} -constraints unix -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label test -menu .m2 menu .m2 -postcommand "glorp" set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {$tearoff postcascade test} msg] $msg [destroy .m1] [destroy .m2] -} {1 {invalid command name "glorp"} {} {}} -test menuDraw-16.6 {TkPostSubMenu} {win userInteraction} { - catch {destroy .m1} - catch {destroy .m2} + $tearoff postcascade test +} -cleanup { + deleteWindows +} -returnCodes error -result {invalid command name "glorp"} +test menuDraw-16.6 {TkPostSubMenu} -constraints { + win userInteraction +} -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to get rid of this menu" set tearoff [tk::TearOffMenu .m1 40 40] - list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] -} {{} {} {}} + $tearoff postcascade 0 +} -cleanup { + deleteWindows +} -result {} -test menuDraw-17.1 {AdjustMenuCoords - menubar} unix { - catch {destroy .m1} - catch {destroy .m2} + +test menuDraw-17.1 {AdjustMenuCoords - menubar} -constraints unix -setup { + deleteWindows +} -body { menu .m1 -tearoff 0 .m1 add cascade -label test -menu .m2 menu .m2 -tearoff 0 .m2 add command -label foo . configure -menu .m1 foreach w [winfo children .] { - if {[$w cget -type] == "menubar"} { - break - } + if {[$w cget -type] == "menubar"} { + break + } } - list [$w postcascade 0] [. configure -menu ""] [destroy .m1] [destroy .m2] -} {{} {} {} {}} -test menuDraw-17.2 {AdjustMenuCoords - menu} {win userInteraction} { - catch {destroy .m1} - catch {destroy .m2} + list [$w postcascade 0] [. configure -menu ""] +} -cleanup { + deleteWindows +} -result {{} {}} +test menuDraw-17.2 {AdjustMenuCoords - menu} -constraints { + win userInteraction +} -setup { + deleteWindows +} -body { menu .m1 .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to make this menu go away" set tearoff [tk::TearOffMenu .m1 40 40] - list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] -} {{} {} {}} + $tearoff postcascade 0 +} -cleanup { + deleteWindows +} -result {} # cleanup deleteWindows cleanupTests return + diff --git a/tests/msgbox.test b/tests/msgbox.test index a351d0b..1056030 100644 --- a/tests/msgbox.test +++ b/tests/msgbox.test @@ -5,68 +5,82 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: msgbox.test,v 1.9 2004/05/24 21:23:23 dkf Exp $ +# RCS: @(#) $Id: msgbox.test,v 1.10 2008/08/21 11:19:33 aniap Exp $ # -package require tcltest 2.1 +package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands +namespace import -force tcltest::test -test msgbox-1.1 {tk_messageBox command} { - list [catch {tk_messageBox -foo} msg] $msg -} {1 {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type}} -test msgbox-1.2 {tk_messageBox command} { - list [catch {tk_messageBox -foo bar} msg] $msg -} {1 {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type}} - -catch {tk_messageBox -foo bar} msg -regsub -all , $msg "" options -regsub \"-foo\" $options "" options - -foreach option $options { - if {[string index $option 0] eq "-"} { - test msgbox-1.3$option {tk_messageBox command} -body { - tk_messageBox $option - } -returnCodes error -result "value for \"$option\" missing" - } -} -test msgbox-1.4 {tk_messageBox command} { - list [catch {tk_messageBox -default} msg] $msg -} {1 {value for "-default" missing}} +test msgbox-1.1 {tk_messageBox command} -body { + tk_messageBox -foo +} -returnCodes error -result {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type} +test msgbox-1.2 {tk_messageBox command} -body { + tk_messageBox -foo bar +} -returnCodes error -result {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type} -test msgbox-1.5 {tk_messageBox command} { - list [catch {tk_messageBox -type foo} msg] $msg -} {1 {bad -type value "foo": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel}} +test msgbox-1.3 {tk_messageBox command} -body { + tk_messageBox -default +} -returnCodes error -result {value for "-default" missing} +test msgbox-1.4 {tk_messageBox command} -body { + tk_messageBox -detail +} -returnCodes error -result {value for "-detail" missing} +test msgbox-1.5 {tk_messageBox command} -body { + tk_messageBox -icon +} -returnCodes error -result {value for "-icon" missing} +test msgbox-1.6 {tk_messageBox command} -body { + tk_messageBox -message +} -returnCodes error -result {value for "-message" missing} +test msgbox-1.7 {tk_messageBox command} -body { + tk_messageBox -parent +} -returnCodes error -result {value for "-parent" missing} +test msgbox-1.8 {tk_messageBox command} -body { + tk_messageBox -title +} -returnCodes error -result {value for "-title" missing} +test msgbox-1.9 {tk_messageBox command} -body { + tk_messageBox -type +} -returnCodes error -result {value for "-type" missing} -proc createPlatformMsg {val} { - global tcl_platform - if {$tcl_platform(platform) == "unix"} { - return "invalid default button \"$val\"" - } - return "bad -default value \"$val\": must be abort, retry, ignore, ok, cancel, no, or yes" -} +test msgbox-1.10 {tk_messageBox command} -body { + tk_messageBox -default +} -returnCodes error -result {value for "-default" missing} + +test msgbox-1.11 {tk_messageBox command} -body { + tk_messageBox -type foo +} -returnCodes error -result {bad -type value "foo": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel} -test msgbox-1.6 {tk_messageBox command} { - list [catch {tk_messageBox -default 1.1} msg] $msg -} [list 1 [createPlatformMsg "1.1"]] +test msgbox-1.12 {tk_messageBox command} -constraints unix -body { + tk_messageBox -default 1.1 +} -returnCodes error -result {invalid default button "1.1"} +test msgbox-1.13 {tk_messageBox command} -constraints macOrWin -body { + tk_messageBox -default 1.1 +} -returnCodes error -result {bad -default value "1.1": must be abort, retry, ignore, ok, cancel, no, or yes} -test msgbox-1.7 {tk_messageBox command} { - list [catch {tk_messageBox -default foo} msg] $msg -} [list 1 [createPlatformMsg "foo"]] +test msgbox-1.14 {tk_messageBox command} -constraints unix -body { + tk_messageBox -default foo +} -returnCodes error -result {invalid default button "foo"} +test msgbox-1.15 {tk_messageBox command} -constraints macOrWin -body { + tk_messageBox -default foo +} -returnCodes error -result {bad -default value "foo": must be abort, retry, ignore, ok, cancel, no, or yes} -test msgbox-1.8 {tk_messageBox command} { - list [catch {tk_messageBox -type yesno -default 3} msg] $msg -} [list 1 [createPlatformMsg "3"]] +test msgbox-1.16 {tk_messageBox command} -constraints unix -body { + tk_messageBox -type yesno -default 3 +} -returnCodes error -result {invalid default button "3"} +test msgbox-1.17 {tk_messageBox command} -constraints macOrWin -body { + tk_messageBox -type yesno -default 3 +} -returnCodes error -result {bad -default value "3": must be abort, retry, ignore, ok, cancel, no, or yes} -test msgbox-1.9 {tk_messageBox command} { - list [catch {tk_messageBox -icon foo} msg] $msg -} {1 {bad -icon value "foo": must be error, info, question, or warning}} +test msgbox-1.18 {tk_messageBox command} -body { + tk_messageBox -icon foo +} -returnCodes error -result {bad -icon value "foo": must be error, info, question, or warning} +test msgbox-1.19 {tk_messageBox command} -body { + tk_messageBox -parent foo.bar +} -returnCodes error -result {bad window path name "foo.bar"} -test msgbox-1.10 {tk_messageBox command} { - list [catch {tk_messageBox -parent foo.bar} msg] $msg -} {1 {bad window path name "foo.bar"}} +catch {tk_messageBox -foo bar} set isNative [expr {[info commands tk::MessageBox] == ""}] proc ChooseMsg {parent btn} { @@ -107,72 +121,332 @@ proc SendEventToMsg {parent btn type} { event generate $w <KeyPress> -keysym Return } } - -set parent . - -set specs { - {"abortretryignore" MB_ABORTRETRYIGNORE 3 {"abort" "retry" "ignore"}} - {"ok" MB_OK 1 {"ok" }} - {"okcancel" MB_OKCANCEL 2 {"ok" "cancel" }} - {"retrycancel" MB_RETRYCANCEL 2 {"retry" "cancel" }} - {"yesno" MB_YESNO 2 {"yes" "no" }} - {"yesnocancel" MB_YESNOCANCEL 3 {"yes" "no" "cancel"}} -} - # # Try out all combinations of (type) x (default button) and # (type) x (icon). # -set count 1 -foreach spec $specs { - set type [lindex $spec 0] - set buttons [lindex $spec 3] - - set button [lindex $buttons 0] - test msgbox-2.$count {tk_messageBox command} nonUnixUserInteraction { - ChooseMsg $parent $button - tk_messageBox -title Hi -message "Please press $button" \ - -type $type - } $button - incr count - - foreach icon {warning error info question} { - test msgbox-2.$count {tk_messageBox command -icon option} \ - nonUnixUserInteraction { - ChooseMsg $parent $button - tk_messageBox -title Hi -message "Please press $button" \ - -type $type -icon $icon - } $button - incr count - } +test msgbox-2.1 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . abort + tk_messageBox -title Hi -message "Please press abort" -type abortretryignore +} -result {abort} +test msgbox-2.2 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . abort + tk_messageBox -title Hi -message "Please press abort" \ + -type abortretryignore -icon warning +} -result {abort} +test msgbox-2.3 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . abort + tk_messageBox -title Hi -message "Please press abort" \ + -type abortretryignore -icon error +} -result {abort} +test msgbox-2.4 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . abort + tk_messageBox -title Hi -message "Please press abort" \ + -type abortretryignore -icon info +} -result {abort} +test msgbox-2.5 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . abort + tk_messageBox -title Hi -message "Please press abort" \ + -type abortretryignore -icon question +} -result {abort} +test msgbox-2.6 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . abort + tk_messageBox -title Hi -message "Please press abort" \ + -type abortretryignore -default abort +} -result {abort} +test msgbox-2.7 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . retry + tk_messageBox -title Hi -message "Please press retry" \ + -type abortretryignore -default retry +} -result {retry} +test msgbox-2.8 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ignore + tk_messageBox -title Hi -message "Please press ignore" \ + -type abortretryignore -default ignore +} -result {ignore} +test msgbox-2.9 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" -type ok +} -result {ok} +test msgbox-2.10 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type ok -icon warning +} -result {ok} +test msgbox-2.11 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type ok -icon error +} -result {ok} +test msgbox-2.12 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type ok -icon info +} -result {ok} +test msgbox-2.13 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type ok -icon question +} -result {ok} +test msgbox-2.14 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type ok -default ok +} -result {ok} +test msgbox-2.15 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" -type okcancel +} -result {ok} +test msgbox-2.16 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type okcancel -icon warning +} -result {ok} +test msgbox-2.17 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type okcancel -icon error +} -result {ok} +test msgbox-2.18 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type okcancel -icon info +} -result {ok} +test msgbox-2.19 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type okcancel -icon question +} -result {ok} +test msgbox-2.20 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . ok + tk_messageBox -title Hi -message "Please press ok" \ + -type okcancel -default ok +} -result {ok} +test msgbox-2.21 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . cancel + tk_messageBox -title Hi -message "Please press cancel" \ + -type okcancel -default cancel +} -result {cancel} +test msgbox-2.22 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . retry + tk_messageBox -title Hi -message "Please press retry" -type retrycancel +} -result {retry} +test msgbox-2.23 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . retry + tk_messageBox -title Hi -message "Please press retry" \ + -type retrycancel -icon warning +} -result {retry} +test msgbox-2.24 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . retry + tk_messageBox -title Hi -message "Please press retry" \ + -type retrycancel -icon error +} -result {retry} +test msgbox-2.25 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . retry + tk_messageBox -title Hi -message "Please press retry" \ + -type retrycancel -icon info +} -result {retry} +test msgbox-2.26 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . retry + tk_messageBox -title Hi -message "Please press retry" \ + -type retrycancel -icon question +} -result {retry} +test msgbox-2.27 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . retry + tk_messageBox -title Hi -message "Please press retry" \ + -type retrycancel -default retry +} -result {retry} +test msgbox-2.28 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . cancel + tk_messageBox -title Hi -message "Please press cancel" \ + -type retrycancel -default cancel +} -result {cancel} +test msgbox-2.29 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" -type yesno +} -result {yes} +test msgbox-2.30 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesno -icon warning +} -result {yes} +test msgbox-2.31 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesno -icon error +} -result {yes} +test msgbox-2.32 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesno -icon info +} -result {yes} +test msgbox-2.33 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesno -icon question +} -result {yes} +test msgbox-2.34 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesno -default yes +} -result {yes} +test msgbox-2.35 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . no + tk_messageBox -title Hi -message "Please press no" \ + -type yesno -default no +} -result {no} +test msgbox-2.36 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" -type yesnocancel +} -result {yes} +test msgbox-2.37 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesnocancel -icon warning +} -result {yes} +test msgbox-2.38 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesnocancel -icon error +} -result {yes} +test msgbox-2.39 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesnocancel -icon info +} -result {yes} +test msgbox-2.40 {tk_messageBox command -icon option} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesnocancel -icon question +} -result {yes} +test msgbox-2.41 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . yes + tk_messageBox -title Hi -message "Please press yes" \ + -type yesnocancel -default yes +} -result {yes} +test msgbox-2.42 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . no + tk_messageBox -title Hi -message "Please press no" \ + -type yesnocancel -default no +} -result {no} +test msgbox-2.43 {tk_messageBox command} -constraints { + nonUnixUserInteraction +} -body { + ChooseMsg . cancel + tk_messageBox -title Hi -message "Please press cancel" \ + -type yesnocancel -default cancel +} -result {cancel} - foreach button $buttons { - test msgbox-2.$count {tk_messageBox command} nonUnixUserInteraction { - ChooseMsg $parent $button - tk_messageBox -title Hi -message "Please press $button" \ - -type $type -default $button - } "$button" - incr count - } -} # These tests will hang your test suite if they fail. -test msgbox-3.1 {tk_messageBox handles withdrawn parent} nonUnixUserInteraction { +test msgbox-3.1 {tk_messageBox handles withdrawn parent} -constraints { + nonUnixUserInteraction +} -body { wm withdraw . ChooseMsg . "ok" tk_messageBox -title Hi -message "Please press ok" \ -type ok -default ok -} "ok" -wm deiconify . +} -cleanup { + wm deiconify . +} -result {ok} -test msgbox-3.2 {tk_messageBox handles iconified parent} nonUnixUserInteraction { +test msgbox-3.2 {tk_messageBox handles iconified parent} -constraints { + nonUnixUserInteraction +} -body { wm iconify . ChooseMsg . "ok" tk_messageBox -title Hi -message "Please press ok" \ -type ok -default ok -} "ok" -wm deiconify . +} -cleanup { + wm deiconify . +} -result {ok} # cleanup cleanupTests return + + diff --git a/tests/oldpack.test b/tests/oldpack.test index 445b0a1..76cf054 100644 --- a/tests/oldpack.test +++ b/tests/oldpack.test @@ -7,15 +7,16 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: oldpack.test,v 1.8 2004/12/04 00:04:41 dkf Exp $ +# RCS: @(#) $Id: oldpack.test,v 1.9 2008/08/21 11:19:33 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands +namespace import -force tcltest::test # First, test a single window packed in various ways in a parent -catch {destroy .pack} +destroy .pack frame .pack place .pack -width 100 -height 100 frame .pack.red -width 10 -height 20 @@ -31,189 +32,189 @@ frame .pack.violet -width 80 -height 20 label .pack.violet.l -text P -bd 2 -relief raised place .pack.violet.l -relwidth 1.0 -relheight 1.0 -test oldpack-1.1 {basic positioning} { +test oldpack-1.1 {basic positioning} -body { pack ap .pack .pack.red top update winfo geometry .pack.red -} 10x20+45+0 -test oldpack-1.2 {basic positioning} { +} -result 10x20+45+0 +test oldpack-1.2 {basic positioning} -body { pack append .pack .pack.red bottom update winfo geometry .pack.red -} 10x20+45+80 -test oldpack-1.3 {basic positioning} { +} -result 10x20+45+80 +test oldpack-1.3 {basic positioning} -body { pack append .pack .pack.red left update winfo geometry .pack.red -} 10x20+0+40 -test oldpack-1.4 {basic positioning} { +} -result 10x20+0+40 +test oldpack-1.4 {basic positioning} -body { pack append .pack .pack.red right update winfo geometry .pack.red -} 10x20+90+40 +} -result 10x20+90+40 # Try adding padding around the window and make sure that the # window gets a larger frame. -test oldpack-2.1 {padding} { +test oldpack-2.1 {padding} -body { pack append .pack .pack.red {t padx 20} update winfo geometry .pack.red -} 10x20+45+0 -test oldpack-2.2 {padding} { +} -result 10x20+45+0 +test oldpack-2.2 {padding} -body { pack append .pack .pack.red {top pady 20} update winfo geometry .pack.red -} 10x20+45+10 -test oldpack-2.3 {padding} { +} -result 10x20+45+10 +test oldpack-2.3 {padding} -body { pack append .pack .pack.red {l padx 20} update winfo geometry .pack.red -} 10x20+10+40 -test oldpack-2.4 {padding} { +} -result 10x20+10+40 +test oldpack-2.4 {padding} -body { pack append .pack .pack.red {left pady 20} update winfo geometry .pack.red -} 10x20+0+40 +} -result 10x20+0+40 # Position the window at different positions in its frame to # make sure they all work. Try two differenet frame locations, # to make sure that frame offsets are being added in correctly. -test oldpack-3.1 {framing} { +test oldpack-3.1 {framing} -body { pack append .pack .pack.red {b padx 20 pady 30} update winfo geometry .pack.red -} 10x20+45+65 -test oldpack-3.2 {framing} { +} -result 10x20+45+65 +test oldpack-3.2 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 fr n} update winfo geometry .pack.red -} 10x20+45+50 -test oldpack-3.3 {framing} { +} -result 10x20+45+50 +test oldpack-3.3 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame ne} update winfo geometry .pack.red -} 10x20+90+50 -test oldpack-3.4 {framing} { +} -result 10x20+90+50 +test oldpack-3.4 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame e} update winfo geometry .pack.red -} 10x20+90+65 -test oldpack-3.5 {framing} { +} -result 10x20+90+65 +test oldpack-3.5 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame se} update winfo geometry .pack.red -} 10x20+90+80 -test oldpack-3.6 {framing} { +} -result 10x20+90+80 +test oldpack-3.6 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame s} update winfo geometry .pack.red -} 10x20+45+80 -test oldpack-3.7 {framing} { +} -result 10x20+45+80 +test oldpack-3.7 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame sw} update winfo geometry .pack.red -} 10x20+0+80 -test oldpack-3.8 {framing} { +} -result 10x20+0+80 +test oldpack-3.8 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame w} update winfo geometry .pack.red -} 10x20+0+65 -test oldpack-3.9 {framing} { +} -result 10x20+0+65 +test oldpack-3.9 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame nw} update winfo geometry .pack.red -} 10x20+0+50 -test oldpack-3.10 {framing} { +} -result 10x20+0+50 +test oldpack-3.10 {framing} -body { pack append .pack .pack.red {bottom padx 20 pady 30 frame c} update winfo geometry .pack.red -} 10x20+45+65 -test oldpack-3.11 {framing} { +} -result 10x20+45+65 +test oldpack-3.11 {framing} -body { pack append .pack .pack.red {r padx 20 pady 30} update winfo geometry .pack.red -} 10x20+80+40 -test oldpack-3.12 {framing} { +} -result 10x20+80+40 +test oldpack-3.12 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame n} update winfo geometry .pack.red -} 10x20+80+0 -test oldpack-3.13 {framing} { +} -result 10x20+80+0 +test oldpack-3.13 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame ne} update winfo geometry .pack.red -} 10x20+90+0 -test oldpack-3.14 {framing} { +} -result 10x20+90+0 +test oldpack-3.14 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame e} update winfo geometry .pack.red -} 10x20+90+40 -test oldpack-3.15 {framing} { +} -result 10x20+90+40 +test oldpack-3.15 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame se} update winfo geometry .pack.red -} 10x20+90+80 -test oldpack-3.16 {framing} { +} -result 10x20+90+80 +test oldpack-3.16 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame s} update winfo geometry .pack.red -} 10x20+80+80 -test oldpack-3.17 {framing} { +} -result 10x20+80+80 +test oldpack-3.17 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame sw} update winfo geometry .pack.red -} 10x20+70+80 -test oldpack-3.18 {framing} { +} -result 10x20+70+80 +test oldpack-3.18 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame w} update winfo geometry .pack.red -} 10x20+70+40 -test oldpack-3.19 {framing} { +} -result 10x20+70+40 +test oldpack-3.19 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame nw} update winfo geometry .pack.red -} 10x20+70+0 -test oldpack-3.20 {framing} { +} -result 10x20+70+0 +test oldpack-3.20 {framing} -body { pack append .pack .pack.red {right padx 20 pady 30 frame center} update winfo geometry .pack.red -} 10x20+80+40 +} -result 10x20+80+40 # Try out various filling combinations in a couple of different # frame locations. -test oldpack-4.1 {filling} { +test oldpack-4.1 {filling} -body { pack append .pack .pack.red {bottom padx 20 pady 30 fillx} update winfo geometry .pack.red -} 100x20+0+65 -test oldpack-4.2 {filling} { +} -result 100x20+0+65 +test oldpack-4.2 {filling} -body { pack append .pack .pack.red {bottom padx 20 pady 30 filly} update winfo geometry .pack.red -} 10x50+45+50 -test oldpack-4.3 {filling} { +} -result 10x50+45+50 +test oldpack-4.3 {filling} -body { pack append .pack .pack.red {bottom padx 20 pady 30 fill} update winfo geometry .pack.red -} 100x50+0+50 -test oldpack-4.4 {filling} { +} -result 100x50+0+50 +test oldpack-4.4 {filling} -body { pack append .pack .pack.red {right padx 20 pady 30 fillx} update winfo geometry .pack.red -} 30x20+70+40 -test oldpack-4.5 {filling} { +} -result 30x20+70+40 +test oldpack-4.5 {filling} -body { pack append .pack .pack.red {right padx 20 pady 30 filly} update winfo geometry .pack.red -} 10x100+80+0 -test oldpack-4.6 {filling} { +} -result 10x100+80+0 +test oldpack-4.6 {filling} -body { pack append .pack .pack.red {right padx 20 pady 30 fill} update winfo geometry .pack.red -} 30x100+70+0 +} -result 30x100+70+0 # Multiple windows: make sure that space is properly subtracted # from the cavity as windows are positioned inwards from all @@ -221,57 +222,128 @@ test oldpack-4.6 {filling} { # there isn't enough space for them. pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top + .pack.violet top update -test oldpack-5.1 {multiple windows} {winfo geometry .pack.red} 10x20+45+0 -test oldpack-5.2 {multiple windows} {winfo geometry .pack.green} 30x40+35+20 -test oldpack-5.3 {multiple windows} {winfo geometry .pack.blue} 40x40+30+60 -test oldpack-5.4 {multiple windows} {winfo ismapped .pack.violet} 0 +test oldpack-5.1 {multiple windows} -body { + winfo geometry .pack.red +} -result 10x20+45+0 +test oldpack-5.2 {multiple windows} -body { + winfo geometry .pack.green +} -result 30x40+35+20 +test oldpack-5.3 {multiple windows} -body { + winfo geometry .pack.blue +} -result 40x40+30+60 +test oldpack-5.4 {multiple windows} -body { + winfo ismapped .pack.violet +} -result 0 + pack b .pack.blue .pack.violet top update -test oldpack-5.5 {multiple windows} {winfo ismapped .pack.violet} 1 -test oldpack-5.6 {multiple windows} {winfo geometry .pack.violet} 80x20+10+60 -test oldpack-5.7 {multiple windows} {winfo geometry .pack.blue} 40x20+30+80 +test oldpack-5.5 {multiple windows} -body { + winfo ismapped .pack.violet +} -result 1 +test oldpack-5.6 {multiple windows} -body { + winfo geometry .pack.violet +} -result 80x20+10+60 +test oldpack-5.7 {multiple windows} -body { + winfo geometry .pack.blue +} -result 40x20+30+80 + pack after .pack.blue .pack.red top update -test oldpack-5.8 {multiple windows} {winfo geometry .pack.green} 30x40+35+0 -test oldpack-5.9 {multiple windows} {winfo geometry .pack.violet} 80x20+10+40 -test oldpack-5.10 {multiple windows} {winfo geometry .pack.blue} 40x40+30+60 -test oldpack-5.11 {multiple windows} {winfo ismapped .pack.red} 0 +test oldpack-5.8 {multiple windows} -body { + winfo geometry .pack.green +} -result 30x40+35+0 +test oldpack-5.9 {multiple windows} -body { + winfo geometry .pack.violet +} -result 80x20+10+40 +test oldpack-5.10 {multiple windows} -body { + winfo geometry .pack.blue +} -result 40x40+30+60 +test oldpack-5.11 {multiple windows} -body { + winfo ismapped .pack.red +} -result 0 + pack before .pack.green .pack.red right .pack.blue left update -test oldpack-5.12 {multiple windows} {winfo ismapped .pack.red} 1 -test oldpack-5.13 {multiple windows} {winfo geometry .pack.red} 10x20+90+40 -test oldpack-5.14 {multiple windows} {winfo geometry .pack.blue} 40x40+0+30 -test oldpack-5.15 {multiple windows} {winfo geometry .pack.green} 30x40+50+0 -test oldpack-5.16 {multiple windows} {winfo geometry .pack.violet} 50x20+40+40 +test oldpack-5.12 {multiple windows} -body { + winfo ismapped .pack.red +} -result 1 +test oldpack-5.13 {multiple windows} -body { + winfo geometry .pack.red +} -result 10x20+90+40 +test oldpack-5.14 {multiple windows} -body { + winfo geometry .pack.blue +} -result 40x40+0+30 +test oldpack-5.15 {multiple windows} -body { + winfo geometry .pack.green +} -result 30x40+50+0 +test oldpack-5.16 {multiple windows} -body { + winfo geometry .pack.violet +} -result 50x20+40+40 + pack append .pack .pack.violet left .pack.green bottom .pack.red bottom \ - .pack.blue bottom + .pack.blue bottom update -test oldpack-5.17 {multiple windows} {winfo geometry .pack.violet} 80x20+0+40 -test oldpack-5.18 {multiple windows} {winfo geometry .pack.green} 20x40+80+60 -test oldpack-5.19 {multiple windows} {winfo geometry .pack.red} 10x20+85+40 -test oldpack-5.20 {multiple windows} {winfo geometry .pack.blue} 20x40+80+0 +test oldpack-5.17 {multiple windows} -body { + winfo geometry .pack.violet +} -result 80x20+0+40 +test oldpack-5.18 {multiple windows} -body { + winfo geometry .pack.green +} -result 20x40+80+60 +test oldpack-5.19 {multiple windows} -body { + winfo geometry .pack.red +} -result 10x20+85+40 +test oldpack-5.20 {multiple windows} -body { + winfo geometry .pack.blue +} -result 20x40+80+0 + pack after .pack.blue .pack.blue top .pack.red right .pack.green right \ - .pack.violet right + .pack.violet right update -test oldpack-5.21 {multiple windows} {winfo geometry .pack.blue} 40x40+30+0 -test oldpack-5.22 {multiple windows} {winfo geometry .pack.red} 10x20+90+60 -test oldpack-5.23 {multiple windows} {winfo geometry .pack.green} 30x40+60+50 -test oldpack-5.24 {multiple windows} {winfo geometry .pack.violet} 60x20+0+60 +test oldpack-5.21 {multiple windows} -body { + winfo geometry .pack.blue +} -result 40x40+30+0 +test oldpack-5.22 {multiple windows} -body { + winfo geometry .pack.red +} -result 10x20+90+60 +test oldpack-5.23 {multiple windows} -body { + winfo geometry .pack.green +} -result 30x40+60+50 +test oldpack-5.24 {multiple windows} -body { + winfo geometry .pack.violet +} -result 60x20+0+60 + pack after .pack.blue .pack.red left .pack.green left .pack.violet left update -test oldpack-5.25 {multiple windows} {winfo geometry .pack.blue} 40x40+30+0 -test oldpack-5.26 {multiple windows} {winfo geometry .pack.red} 10x20+0+60 -test oldpack-5.27 {multiple windows} {winfo geometry .pack.green} 30x40+10+50 -test oldpack-5.28 {multiple windows} {winfo geometry .pack.violet} 60x20+40+60 +test oldpack-5.25 {multiple windows} -body { + winfo geometry .pack.blue +} -result 40x40+30+0 +test oldpack-5.26 {multiple windows} -body { + winfo geometry .pack.red +} -result 10x20+0+60 +test oldpack-5.27 {multiple windows} -body { + winfo geometry .pack.green +} -result 30x40+10+50 +test oldpack-5.28 {multiple windows} -body { + winfo geometry .pack.violet +} -result 60x20+40+60 + pack append .pack .pack.violet left .pack.green left .pack.blue left \ - .pack.red left + .pack.red left update -test oldpack-5.29 {multiple windows} {winfo geometry .pack.violet} 80x20+0+40 -test oldpack-5.30 {multiple windows} {winfo geometry .pack.green} 20x40+80+30 -test oldpack-5.31 {multiple windows} {winfo ismapped .pack.blue} 0 -test oldpack-5.32 {multiple windows} {winfo ismapped .pack.red} 0 +test oldpack-5.29 {multiple windows} -body { + winfo geometry .pack.violet +} -result 80x20+0+40 +test oldpack-5.30 {multiple windows} -body { + winfo geometry .pack.green +} -result 20x40+80+30 +test oldpack-5.31 {multiple windows} -body { + winfo ismapped .pack.blue +} -result 0 +test oldpack-5.32 {multiple windows} -body { + winfo ismapped .pack.red +} -result 0 # Test the ability of the packer to propagate geometry information @@ -281,84 +353,92 @@ test oldpack-5.32 {multiple windows} {winfo ismapped .pack.red} 0 # "left" and "right" windows). pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top + .pack.violet top update -test oldpack-6.1 {geometry propagation} {winfo reqwidth .pack} 80 -test oldpack-6.2 {geometry propagation} {winfo reqheight .pack} 120 +test oldpack-6.1 {geometry propagation} -body { + winfo reqwidth .pack} -result 80 +test oldpack-6.2 {geometry propagation} -body { + winfo reqheight .pack} -result 120 destroy .pack.violet update -test oldpack-6.3 {geometry propagation} {winfo reqwidth .pack} 40 -test oldpack-6.4 {geometry propagation} {winfo reqheight .pack} 100 +test oldpack-6.3 {geometry propagation} -body { + winfo reqwidth .pack} -result 40 +test oldpack-6.4 {geometry propagation} -body { + winfo reqheight .pack} -result 100 frame .pack.violet -width 80 -height 20 -bg violet label .pack.violet.l -text P -bd 2 -relief raised place .pack.violet.l -relwidth 1.0 -relheight 1.0 pack append .pack .pack.red left .pack.green right .pack.blue bottom \ - .pack.violet top + .pack.violet top update -test oldpack-6.5 {geometry propagation} {winfo reqwidth .pack} 120 -test oldpack-6.6 {geometry propagation} {winfo reqheight .pack} 60 +test oldpack-6.5 {geometry propagation} -body { + winfo reqwidth .pack} -result 120 +test oldpack-6.6 {geometry propagation} -body { + winfo reqheight .pack} -result 60 pack append .pack .pack.violet top .pack.green top .pack.blue left \ - .pack.red left + .pack.red left update -test oldpack-6.7 {geometry propagation} {winfo reqwidth .pack} 80 -test oldpack-6.8 {geometry propagation} {winfo reqheight .pack} 100 +test oldpack-6.7 {geometry propagation} -body { + winfo reqwidth .pack} -result 80 +test oldpack-6.8 {geometry propagation} -body { + winfo reqheight .pack} -result 100 # Test the "expand" option, and make sure space is evenly divided # when several windows request expansion. pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} + .pack.blue {left expand} .pack.red {left expand} update -test oldpack-7.1 {multiple expanded windows} { +test oldpack-7.1 {multiple expanded windows} -body { pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} + .pack.blue {left expand} .pack.red {left expand} update list [winfo geometry .pack.green] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} {30x40+3+40 40x40+39+40 10x20+86+50} -test oldpack-7.2 {multiple expanded windows} { + [winfo geometry .pack.red] +} -result {30x40+3+40 40x40+39+40 10x20+86+50} +test oldpack-7.2 {multiple expanded windows} -body { pack append .pack .pack.green left .pack.violet {bottom expand} \ - .pack.blue {bottom expand} .pack.red {bottom expand} + .pack.blue {bottom expand} .pack.red {bottom expand} update list [winfo geometry .pack.violet] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} {70x20+30+77 40x40+45+30 10x20+60+3} -test oldpack-7.3 {multiple expanded windows} { + [winfo geometry .pack.red] +} -result {70x20+30+77 40x40+45+30 10x20+60+3} +test oldpack-7.3 {multiple expanded windows} -body { foreach i [winfo child .pack] { - pack unpack $i + pack unpack $i } pack append .pack .pack.green {left e fill} .pack.red {left expand fill} \ - .pack.blue {top fill} + .pack.blue {top fill} update list [winfo geometry .pack.green] [winfo geometry .pack.red] \ - [winfo geometry .pack.blue] -} {40x100+0+0 20x100+40+0 40x40+60+0} -test oldpack-7.4 {multiple expanded windows} { + [winfo geometry .pack.blue] +} -result {40x100+0+0 20x100+40+0 40x40+60+0} +test oldpack-7.4 {multiple expanded windows} -body { foreach i [winfo child .pack] { - pack unpack $i + pack unpack $i } pack append .pack .pack.red {top expand} .pack.violet {top expand} \ - .pack.blue {right fill} + .pack.blue {right fill} update list [winfo geometry .pack.red] [winfo geometry .pack.violet] \ - [winfo geometry .pack.blue] -} {10x20+45+5 80x20+10+35 40x40+60+60} -test oldpack-7.5 {multiple expanded windows} { + [winfo geometry .pack.blue] +} -result {10x20+45+5 80x20+10+35 40x40+60+60} +test oldpack-7.5 {multiple expanded windows} -body { foreach i [winfo child .pack] { - pack unpack $i + pack unpack $i } pack append .pack .pack.green {right frame s} .pack.red {top expand} update list [winfo geometry .pack.green] [winfo geometry .pack.red] -} {30x40+70+60 10x20+30+40} -test oldpack-7.6 {multiple expanded windows} { +} -result {30x40+70+60 10x20+30+40} +test oldpack-7.6 {multiple expanded windows} -body { foreach i [winfo child .pack] { - pack unpack $i + pack unpack $i } pack append .pack .pack.violet {bottom frame e} .pack.red {right expand} update list [winfo geometry .pack.violet] [winfo geometry .pack.red] -} {80x20+20+80 10x20+45+30} +} -result {80x20+20+80 10x20+45+30} # Need more bizarre tests with combinations of expanded windows and # windows in opposing directions! Also, include padding in expanded @@ -366,146 +446,109 @@ test oldpack-7.6 {multiple expanded windows} { # Syntax errors on pack commands -test oldpack-8.1 {syntax errors} { - set msg "" - set result [catch {pack} msg] - concat $result $msg -} {1 wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.2 {syntax errors} { - set msg "" - set result [catch {pack append} msg] - concat $result $msg -} {1 wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.3 {syntax errors} { - set msg "" - set result [catch {pack gorp foo} msg] - concat $result $msg -} {1 bad option "gorp": must be configure, forget, info, propagate, or slaves} -test oldpack-8.4 {syntax errors} { - set msg "" - set result [catch {pack a .pack} msg] - concat $result $msg -} {1 bad option "a": must be configure, forget, info, propagate, or slaves} -test oldpack-8.5 {syntax errors} { - set msg "" - set result [catch {pack after foobar} msg] - concat $result $msg -} {1 bad window path name "foobar"} -test oldpack-8.6 {syntax errors} { +test oldpack-8.1 {syntax errors} -body { + pack +} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} +test oldpack-8.2 {syntax errors} -body { + pack append +} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} +test oldpack-8.3 {syntax errors} -body { + pack gorp foo +} -returnCodes error -result {bad option "gorp": must be configure, forget, info, propagate, or slaves} +test oldpack-8.4 {syntax errors} -body { + pack a .pack +} -returnCodes error -result {bad option "a": must be configure, forget, info, propagate, or slaves} +test oldpack-8.5 {syntax errors} -body { + pack after foobar +} -returnCodes error -result {bad window path name "foobar"} +test oldpack-8.6 {syntax errors} -setup { + destroy .pack.yellow +} -body { frame .pack.yellow -bg yellow - set msg "" - set result [catch {pack after .pack.yellow} msg] + pack after .pack.yellow +} -cleanup { destroy .pack.yellow - concat $result $msg -} {1 window ".pack.yellow" isn't packed} -test oldpack-8.7 {syntax errors} { - set msg "" - set result [catch {pack append foobar} msg] - concat $result $msg -} {1 bad window path name "foobar"} -test oldpack-8.8 {syntax errors} { - set msg "" - set result [catch {pack before foobar} msg] - concat $result $msg -} {1 bad window path name "foobar"} -test oldpack-8.9 {syntax errors} { +} -returnCodes error -result {window ".pack.yellow" isn't packed} +test oldpack-8.7 {syntax errors} -body { + pack append foobar +} -returnCodes error -result {bad window path name "foobar"} +test oldpack-8.8 {syntax errors} -body { + pack before foobar +} -returnCodes error -result {bad window path name "foobar"} +test oldpack-8.9 {syntax errors} -setup { + destroy .pack.yellow +} -body { frame .pack.yellow -bg yellow - set msg "" - set result [catch {pack before .pack.yellow} msg] + pack before .pack.yellow +} -cleanup { destroy .pack.yellow - concat $result $msg -} {1 window ".pack.yellow" isn't packed} -test oldpack-8.10 {syntax errors} { - set msg "" - set result [catch {pack info .pack help} msg] - concat $result $msg -} {1 wrong # args: should be "pack info window"} -test oldpack-8.11 {syntax errors} { - set msg "" - set result [catch {pack info foobar} msg] - concat $result $msg -} {1 bad window path name "foobar"} -test oldpack-8.12 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue} msg] - concat $result $msg -} {1 wrong # args: window ".pack.blue" should be followed by options} -test oldpack-8.13 {syntax errors} { - set msg "" - set result [catch {pack append . .pack.blue top} msg] - concat $result $msg -} {1 can't pack .pack.blue inside .} -test oldpack-8.14 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue f} msg] - concat $result $msg -} {1 bad option "f": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.15 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue pad} msg] - concat $result $msg -} {1 bad option "pad": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.16 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue {frame south}} msg] - concat $result $msg -} {1 bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center} -test oldpack-8.17 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue {padx -2}} msg] - concat $result $msg -} {1 bad pad value "-2": must be positive screen distance} -test oldpack-8.18 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue {padx}} msg] - concat $result $msg -} {1 wrong # args: "padx" option must be followed by screen distance} -test oldpack-8.19 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue {pady -2}} msg] - concat $result $msg -} {1 bad pad value "-2": must be positive screen distance} -test oldpack-8.20 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue {pady}} msg] - concat $result $msg -} {1 wrong # args: "pady" option must be followed by screen distance} -test oldpack-8.21 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue "\{abc"} msg] - concat $result $msg -} {1 unmatched open brace in list} -test oldpack-8.22 {syntax errors} { - set msg "" - set result [catch {pack append .pack .pack.blue frame} msg] - concat $result $msg -} {1 wrong # args: "frame" option must be followed by anchor point} +} -returnCodes error -result {window ".pack.yellow" isn't packed} +test oldpack-8.10 {syntax errors} -body { + pack info .pack help +} -returnCodes error -result {wrong # args: should be "pack info window"} +test oldpack-8.11 {syntax errors} -body { + pack info foobar +} -returnCodes error -result {bad window path name "foobar"} +test oldpack-8.12 {syntax errors} -body { + pack append .pack .pack.blue +} -returnCodes error -result {wrong # args: window ".pack.blue" should be followed by options} +test oldpack-8.13 {syntax errors} -body { + pack append . .pack.blue top +} -returnCodes error -result {can't pack .pack.blue inside .} +test oldpack-8.14 {syntax errors} -body { + pack append .pack .pack.blue f +} -returnCodes error -result {bad option "f": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} +test oldpack-8.15 {syntax errors} -body { + pack append .pack .pack.blue pad +} -returnCodes error -result {bad option "pad": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} +test oldpack-8.16 {syntax errors} -body { + pack append .pack .pack.blue {frame south} +} -returnCodes error -result {bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center} +test oldpack-8.17 {syntax errors} -body { + pack append .pack .pack.blue {padx -2} +} -returnCodes error -result {bad pad value "-2": must be positive screen distance} +test oldpack-8.18 {syntax errors} -body { + pack append .pack .pack.blue {padx} +} -returnCodes error -result {wrong # args: "padx" option must be followed by screen distance} +test oldpack-8.19 {syntax errors} -body { + pack append .pack .pack.blue {pady -2} +} -returnCodes error -result {bad pad value "-2": must be positive screen distance} +test oldpack-8.20 {syntax errors} -body { + pack append .pack .pack.blue {pady} +} -returnCodes error -result {wrong # args: "pady" option must be followed by screen distance} +test oldpack-8.21 {syntax errors} -body { + pack append .pack .pack.blue "\{abc" +} -returnCodes error -result {unmatched open brace in list} +test oldpack-8.22 {syntax errors} -body { + pack append .pack .pack.blue frame +} -returnCodes error -result {wrong # args: "frame" option must be followed by anchor point} # Test "pack info" command output. -test oldpack-9.1 {information output} { +test oldpack-9.1 {information output} -body { pack append .pack .pack.blue {top fillx frame n} \ - .pack.red {bottom filly frame s} .pack.green {left fill frame w} \ - .pack.violet {right expand frame e} + .pack.red {bottom filly frame s} .pack.green {left fill frame w} \ + .pack.violet {right expand frame e} list [pack slaves .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor n -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor s -expand 0 -fill y -ipadx 0 -ipady 0 -padx 0 -pady 0 -side bottom} {-in .pack -anchor w -expand 0 -fill both -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left} {-in .pack -anchor e -expand 1 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}} -test oldpack-9.2 {information output} { + [pack info .pack.green] [pack info .pack.violet] +} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor n -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor s -expand 0 -fill y -ipadx 0 -ipady 0 -padx 0 -pady 0 -side bottom} {-in .pack -anchor w -expand 0 -fill both -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left} {-in .pack -anchor e -expand 1 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}} +test oldpack-9.2 {information output} -body { pack append .pack .pack.blue {padx 10 frame nw} \ - .pack.red {pady 20 frame ne} .pack.green {frame se} \ - .pack.violet {frame sw} + .pack.red {pady 20 frame ne} .pack.green {frame se} \ + .pack.violet {frame sw} list [pack slaves .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor nw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 5 -pady 0 -side top} {-in .pack -anchor ne -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 10 -side top} {-in .pack -anchor se -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor sw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} -test oldpack-9.3 {information output} { + [pack info .pack.green] [pack info .pack.violet] +} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor nw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 5 -pady 0 -side top} {-in .pack -anchor ne -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 10 -side top} {-in .pack -anchor se -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor sw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} +test oldpack-9.3 {information output} -body { pack append .pack .pack.blue {frame center} .pack.red {frame center} \ - .pack.green {frame c} .pack.violet {frame c} + .pack.green {frame c} .pack.violet {frame c} list [pack slaves .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} + [pack info .pack.green] [pack info .pack.violet] +} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} -catch {destroy .pack} +destroy .pack # cleanup cleanupTests return + diff --git a/tests/pack.test b/tests/pack.test index 27fd01f..8236750 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -6,45 +6,17 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: pack.test,v 1.14 2006/04/05 18:04:39 dgp Exp $ +# RCS: @(#) $Id: pack.test,v 1.15 2008/08/21 11:19:33 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands +namespace import -force tcltest::test -# Utility procedures: - -proc pack1 {args} { - pack forget .pack.a .pack.b .pack.c .pack.d - eval pack .pack.a $args - pack .pack.b -expand yes -fill both - update - list [winfo geometry .pack.a] [winfo geometry .pack.b] -} -proc pack2 {args} { - pack forget .pack.a .pack.b .pack.c .pack.d - eval pack .pack.a $args - update - winfo geometry .pack.a -} -proc pack3 {args} { - pack forget .pack.a .pack.b .pack.c .pack.d - pack .pack.a -side top - pack .pack.c -side left - eval pack .pack.b $args - update - winfo geometry .pack.b -} -proc pack4 {option value} { - pack forget .pack.a .pack.b .pack.c .pack.d - pack .pack.a $option $value - set i [pack info .pack.a] - lindex $i [expr [lsearch -exact $i $option]+1] -} # Create some test windows. -catch {destroy .pack} +destroy .pack toplevel .pack wm geom .pack 300x200+0+0 wm minsize .pack 1 1 @@ -59,400 +31,767 @@ foreach i {a b c d} { .pack.c config -width 80 -height 80 .pack.d config -width 40 -height 30 -test pack-1.1 {-side option} { - pack1 -side top -} {20x40+140+0 300x160+0+40} -test pack-1.2 {-side option} { - pack1 -side bottom -} {20x40+140+160 300x160+0+0} -test pack-1.3 {-side option} { - pack1 -side left -} {20x40+0+80 280x200+20+0} -test pack-1.4 {-side option} { - pack1 -side right -} {20x40+280+80 280x200+0+0} +test pack-1.1 {-side option} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+140+0 300x160+0+40} +test pack-1.2 {-side option} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side bottom + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+140+160 300x160+0+0} +test pack-1.3 {-side option} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side left + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+0+80 280x200+20+0} +test pack-1.4 {-side option} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+280+80 280x200+0+0} -test pack-2.1 {x padding and filling} { - pack1 -side right -padx 20 -} {20x40+260+80 240x200+0+0} -test pack-2.1.1 {x padding and filling} { - pack1 -side right -padx {10 30} -} {20x40+250+80 240x200+0+0} -test pack-2.1.2 {x padding and filling} { - pack1 -side right -padx {35 5} -} {20x40+275+80 240x200+0+0} -test pack-2.2 {x padding and filling} { - pack1 -side right -ipadx 20 -} {60x40+240+80 240x200+0+0} -test pack-2.3 {x padding and filling} { - pack1 -side right -ipadx 5 -padx 10 -} {30x40+260+80 250x200+0+0} -test pack-2.4 {x padding and filling} { - pack1 -side right -padx 20 -fill x -} {20x40+260+80 240x200+0+0} -test pack-2.4.1 {x padding and filling} { - pack1 -side right -padx {9 31} -fill x -} {20x40+249+80 240x200+0+0} -test pack-2.5 {x padding and filling} { - pack1 -side right -ipadx 20 -fill x -} {60x40+240+80 240x200+0+0} -test pack-2.6 {x padding and filling} { - pack1 -side right -ipadx 5 -padx 10 -fill x -} {30x40+260+80 250x200+0+0} -test pack-2.6.1 {x padding and filling} { - pack1 -side right -ipadx 5 -padx {5 15} -fill x -} {30x40+255+80 250x200+0+0} -test pack-2.7 {x padding and filling} { - pack1 -side top -padx 20 -} {20x40+140+0 300x160+0+40} -test pack-2.7.1 {x padding and filling} { - pack1 -side top -padx {0 40} -} {20x40+120+0 300x160+0+40} -test pack-2.7.2 {x padding and filling} { - pack1 -side top -padx {31 9} -} {20x40+151+0 300x160+0+40} -test pack-2.8 {x padding and filling} { - pack1 -side top -ipadx 20 -} {60x40+120+0 300x160+0+40} -test pack-2.9 {x padding and filling} { - pack1 -side top -ipadx 5 -padx 10 -} {30x40+135+0 300x160+0+40} -test pack-2.9.1 {x padding and filling} { - pack1 -side top -ipadx 5 -padx {5 15} -} {30x40+130+0 300x160+0+40} -test pack-2.10 {x padding and filling} { - pack1 -side top -padx 20 -fill x -} {260x40+20+0 300x160+0+40} -test pack-2.10.1 {x padding and filling} { - pack1 -side top -padx {25 15} -fill x -} {260x40+25+0 300x160+0+40} -test pack-2.11 {x padding and filling} { - pack1 -side top -ipadx 20 -fill x -} {300x40+0+0 300x160+0+40} -test pack-2.12 {x padding and filling} { - pack1 -side top -ipadx 5 -padx 10 -fill x -} {280x40+10+0 300x160+0+40} -test pack-2.12a {x padding and filling} { - pack1 -side top -ipadx 5 -padx {5 15} -fill x -} {280x40+5+0 300x160+0+40} -set pad [winfo pixels .pack 1c] -test pack-2.13 {x padding and filling} { + +test pack-2.1 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -padx 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+260+80 240x200+0+0} +test pack-2.2 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -padx {10 30} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+250+80 240x200+0+0} +test pack-2.3 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -padx {35 5} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+275+80 240x200+0+0} +test pack-2.4 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipadx 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {60x40+240+80 240x200+0+0} +test pack-2.5 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipadx 5 -padx 10 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {30x40+260+80 250x200+0+0} +test pack-2.6 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -padx 20 -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+260+80 240x200+0+0} +test pack-2.7 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -padx {9 31} -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+249+80 240x200+0+0} +test pack-2.8 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipadx 20 -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {60x40+240+80 240x200+0+0} +test pack-2.9 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipadx 5 -padx 10 -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {30x40+260+80 250x200+0+0} +test pack-2.10 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipadx 5 -padx {5 15} -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {30x40+255+80 250x200+0+0} +test pack-2.11 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -padx 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+140+0 300x160+0+40} +test pack-2.12 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -padx {0 40} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+120+0 300x160+0+40} +test pack-2.13 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -padx {31 9} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+151+0 300x160+0+40} +test pack-2.14 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {60x40+120+0 300x160+0+40} +test pack-2.15 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {30x40+135+0 300x160+0+40} +test pack-2.16 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx {5 15} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {30x40+130+0 300x160+0+40} +test pack-2.17 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -padx 20 -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {260x40+20+0 300x160+0+40} +test pack-2.18 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -padx {25 15} -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {260x40+25+0 300x160+0+40} +test pack-2.19 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 20 -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {300x40+0+0 300x160+0+40} +test pack-2.20 {x padding and filling} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {280x40+10+0 300x160+0+40} +test pack-2.21 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx {5 15} -fill x + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {280x40+5+0 300x160+0+40} + +test pack-2.22 {x padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -padx 1c set x [pack info .pack.a] - lindex $x [expr [lsearch -exact $x -padx]+1] -} $pad -test pack-2.14 {x padding and filling} { + set res1 [lindex $x [expr [lsearch -exact $x -padx]+1]] + set res2 [winfo pixels .pack 1c] + expr {$res1 eq $res2} +} -result 1 +test pack-2.23 {x padding and filling} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -ipadx 1c set x [pack info .pack.a] - lindex $x [expr [lsearch -exact $x -ipadx]+1] -} $pad + set res1 [lindex $x [expr [lsearch -exact $x -ipadx]+1]] + set res2 [winfo pixels .pack 1c] + expr {$res1 eq $res2} +} -result 1 -test pack-3.1 {y padding and filling} { - pack1 -side right -pady 20 -} {20x40+280+80 280x200+0+0} -test pack-3.1.1 {y padding and filling} { - pack1 -side right -pady {5 35} -} {20x40+280+65 280x200+0+0} -test pack-3.1.2 {y padding and filling} { - pack1 -side right -pady {40 0} -} {20x40+280+100 280x200+0+0} -test pack-3.2 {y padding and filling} { - pack1 -side right -ipady 20 -} {20x80+280+60 280x200+0+0} -test pack-3.3 {y padding and filling} { - pack1 -side right -ipady 5 -pady 10 -} {20x50+280+75 280x200+0+0} -test pack-3.3.1 {y padding and filling} { - pack1 -side right -ipady 5 -pady {5 15} -} {20x50+280+70 280x200+0+0} -test pack-3.4 {y padding and filling} { - pack1 -side right -pady 20 -fill y -} {20x160+280+20 280x200+0+0} -test pack-3.4.1 {y padding and filling} { - pack1 -side right -pady {35 5} -fill y -} {20x160+280+35 280x200+0+0} -test pack-3.5 {y padding and filling} { - pack1 -side right -ipady 20 -fill y -} {20x200+280+0 280x200+0+0} -test pack-3.6 {y padding and filling} { - pack1 -side right -ipady 5 -pady 10 -fill y -} {20x180+280+10 280x200+0+0} -test pack-3.6.1 {y padding and filling} { - pack1 -side right -ipady 5 -pady {0 20} -fill y -} {20x180+280+0 280x200+0+0} -test pack-3.7 {y padding and filling} { - pack1 -side top -pady 20 -} {20x40+140+20 300x120+0+80} -test pack-3.7.1 {y padding and filling} { - pack1 -side top -pady {40 0} -} {20x40+140+40 300x120+0+80} -test pack-3.8 {y padding and filling} { - pack1 -side top -ipady 20 -} {20x80+140+0 300x120+0+80} -test pack-3.9 {y padding and filling} { - pack1 -side top -ipady 5 -pady 10 -} {20x50+140+10 300x130+0+70} -test pack-3.9.1 {y padding and filling} { - pack1 -side top -ipady 5 -pady {3 17} -} {20x50+140+3 300x130+0+70} -test pack-3.10 {y padding and filling} { - pack1 -side top -pady 20 -fill y -} {20x40+140+20 300x120+0+80} -test pack-3.10.1 {y padding and filling} { - pack1 -side top -pady {39 1} -fill y -} {20x40+140+39 300x120+0+80} -test pack-3.11 {y padding and filling} { - pack1 -side top -ipady 20 -fill y -} {20x80+140+0 300x120+0+80} -test pack-3.12 {y padding and filling} { - pack1 -side top -ipady 5 -pady 10 -fill y -} {20x50+140+10 300x130+0+70} -test pack-3.12.1 {y padding and filling} { - pack1 -side top -ipady 5 -pady {1 19} -fill y -} {20x50+140+1 300x130+0+70} -set pad [winfo pixels .pack 1c] -test pack-3.13 {y padding and filling} { + +test pack-3.1 {y padding and filling} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -pady 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+280+80 280x200+0+0} +test pack-3.2 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -pady {5 35} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+280+65 280x200+0+0} +test pack-3.3 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -pady {40 0} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+280+100 280x200+0+0} +test pack-3.4 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipady 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x80+280+60 280x200+0+0} +test pack-3.5 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipady 5 -pady 10 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x50+280+75 280x200+0+0} +test pack-3.6 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipady 5 -pady {5 15} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x50+280+70 280x200+0+0} +test pack-3.7 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -pady 20 -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x160+280+20 280x200+0+0} +test pack-3.8 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -pady {35 5} -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x160+280+35 280x200+0+0} +test pack-3.9 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipady 20 -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x200+280+0 280x200+0+0} +test pack-3.10 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipady 5 -pady 10 -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x180+280+10 280x200+0+0} +test pack-3.11 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side right -ipady 5 -pady {0 20} -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x180+280+0 280x200+0+0} +test pack-3.12 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -pady 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+140+20 300x120+0+80} +test pack-3.13 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -pady {40 0} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+140+40 300x120+0+80} +test pack-3.14 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipady 20 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x80+140+0 300x120+0+80} +test pack-3.15 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipady 5 -pady 10 + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x50+140+10 300x130+0+70} +test pack-3.16 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipady 5 -pady {3 17} + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x50+140+3 300x130+0+70} +test pack-3.17 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -pady 20 -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+140+20 300x120+0+80} +test pack-3.18 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -pady {39 1} -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x40+140+39 300x120+0+80} +test pack-3.19 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipady 20 -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x80+140+0 300x120+0+80} +test pack-3.20 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipady 5 -pady 10 -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x50+140+10 300x130+0+70} +test pack-3.21 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipady 5 -pady {1 19} -fill y + pack .pack.b -expand yes -fill both + update + list [winfo geometry .pack.a] [winfo geometry .pack.b] +} -result {20x50+140+1 300x130+0+70} + +test pack-3.22 {y padding and filling} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -pady 1c set x [pack info .pack.a] - lindex $x [expr [lsearch -exact $x -pady]+1] -} $pad -test pack-3.14 {y padding and filling} { + set res1 [lindex $x [expr [lsearch -exact $x -pady]+1]] + set res2 [winfo pixels .pack 1c] + expr {$res1 eq $res2} +} -result 1 +test pack-3.23 {y padding and filling} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -ipady 1c set x [pack info .pack.a] - lindex $x [expr [lsearch -exact $x -ipady]+1] -} $pad + set res1 [lindex $x [expr [lsearch -exact $x -ipady]+1]] + set res2 [winfo pixels .pack 1c] + expr {$res1 eq $res2} +} -result 1 + + +test pack-4.1 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n + update + winfo geometry .pack.a +} -result {30x70+135+20} +test pack-4.2 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne + update + winfo geometry .pack.a +} -result {30x70+260+20} +test pack-4.3 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e + update + winfo geometry .pack.a +} -result {30x70+260+65} +test pack-4.4 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se + update + winfo geometry .pack.a +} -result {30x70+260+110} +test pack-4.5 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s + update + winfo geometry .pack.a +} -result {30x70+135+110} +test pack-4.6 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw + update + winfo geometry .pack.a +} -result {30x70+10+110} +test pack-4.7 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w + update + winfo geometry .pack.a +} -result {30x70+10+65} +test pack-4.8 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw + update + winfo geometry .pack.a +} -result {30x70+10+20} +test pack-4.9 {anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center + update + winfo geometry .pack.a +} -result {30x70+135+65} -test pack-4.1 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n -} {30x70+135+20} -test pack-4.2 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne -} {30x70+260+20} -test pack-4.3 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e -} {30x70+260+65} -test pack-4.4 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se -} {30x70+260+110} -test pack-4.5 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s -} {30x70+135+110} -test pack-4.6 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw -} {30x70+10+110} -test pack-4.7 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w -} {30x70+10+65} -test pack-4.8 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw -} {30x70+10+20} -test pack-4.9 {anchors} { - pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center -} {30x70+135+65} # Repeat above tests, but with a frame that isn't at (0,0), so that # we can be sure that the frame offset is being added in correctly. -test pack-5.1 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n -} {60x60+160+60} -test pack-5.2 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne -} {60x60+230+60} -test pack-5.3 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e -} {60x60+230+90} -test pack-5.4 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se -} {60x60+230+120} -test pack-5.5 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s -} {60x60+160+120} -test pack-5.6 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw -} {60x60+90+120} -test pack-5.7 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w -} {60x60+90+90} -test pack-5.8 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw -} {60x60+90+60} -test pack-5.9 {more anchors} { - pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center -} {60x60+160+90} +test pack-5.1 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n + update + winfo geometry .pack.b +} -result {60x60+160+60} +test pack-5.2 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne + update + winfo geometry .pack.b +} -result {60x60+230+60} +test pack-5.3 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e + update + winfo geometry .pack.b +} -result {60x60+230+90} +test pack-5.4 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se + update + winfo geometry .pack.b +} -result {60x60+230+120} +test pack-5.5 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s + update + winfo geometry .pack.b +} -result {60x60+160+120} +test pack-5.6 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw + update + winfo geometry .pack.b +} -result {60x60+90+120} +test pack-5.7 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w + update + winfo geometry .pack.b +} -result {60x60+90+90} +test pack-5.8 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw + update + winfo geometry .pack.b +} -result {60x60+90+60} +test pack-5.9 {more anchors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side top + pack .pack.c -side left + pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center + update + winfo geometry .pack.b +} -result {60x60+160+90} + -test pack-6.1 {-expand option} { +test pack-6.1 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side left update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+0+80 50x30+20+85 80x80+70+60 40x30+150+85} -test pack-6.2 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+0+80 50x30+20+85 80x80+70+60 40x30+150+85} +test pack-6.2 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side left -expand yes pack .pack.b -side left pack .pack.c .pack.d -side left -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+18+80 50x30+56+85 80x80+124+60 40x30+241+85} -test pack-6.3 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+18+80 50x30+56+85 80x80+124+60 40x30+241+85} +test pack-6.3 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+140+0 50x30+125+40 80x80+110+70 40x30+130+150} -test pack-6.4 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+140+0 50x30+125+40 80x80+110+70 40x30+130+150} +test pack-6.4 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side top -expand yes pack .pack.b -side top pack .pack.c .pack.d -side top -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+140+3 50x30+125+46 80x80+110+79 40x30+130+166} -test pack-6.5 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+140+3 50x30+125+46 80x80+110+79 40x30+130+166} +test pack-6.5 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side right update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+280+80 50x30+230+85 80x80+150+60 40x30+110+85} -test pack-6.6 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+280+80 50x30+230+85 80x80+150+60 40x30+110+85} +test pack-6.6 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side right -expand yes pack .pack.b -side right pack .pack.c .pack.d -side right -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+262+80 50x30+194+85 80x80+95+60 40x30+18+85} -test pack-6.7 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+262+80 50x30+194+85 80x80+95+60 40x30+18+85} +test pack-6.7 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side bottom update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+140+160 50x30+125+130 80x80+110+50 40x30+130+20} -test pack-6.8 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+140+160 50x30+125+130 80x80+110+50 40x30+130+20} +test pack-6.8 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side bottom -expand yes pack .pack.b -side bottom pack .pack.c .pack.d -side bottom -expand 1 update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {20x40+140+157 50x30+125+124 80x80+110+40 40x30+130+3} -test pack-6.9 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {20x40+140+157 50x30+125+124 80x80+110+40 40x30+130+3} +test pack-6.9 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side bottom -expand yes -fill both pack .pack.b -side right pack .pack.c -side top -expand 1 -fill both pack .pack.d -side left update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {300x65+0+135 50x30+250+52 250x105+0+0 40x30+0+105} -test pack-6.10 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {300x65+0+135 50x30+250+52 250x105+0+0 40x30+0+105} +test pack-6.10 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side left -expand yes -fill both pack .pack.b -side top pack .pack.c -side right -expand 1 -fill both pack .pack.d -side bottom update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {100x200+0+0 50x30+175+0 160x170+140+30 40x30+100+170} -test pack-6.11 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {100x200+0+0 50x30+175+0 160x170+140+30 40x30+100+170} +test pack-6.11 {-expand option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side left -expand yes -fill both pack .pack.b -side top -expand yes -fill both pack .pack.c -side right -expand 1 -fill both pack .pack.d -side bottom -expand yes -fill both update list [winfo geometry .pack.a] [winfo geometry .pack.b] \ - [winfo geometry .pack.c] [winfo geometry .pack.d] -} {100x200+0+0 200x100+100+0 160x100+140+100 40x100+100+100} -catch {destroy .pack2} -toplevel .pack2 -height 400 -width 400 -wm geometry .pack2 +0+0 -pack propagate .pack2 0 -pack forget .pack2.a .pack2.b .pack2.c .pack2.d -foreach i {w1 w2 w3} { - frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised - label .pack2.$i.l -text $i - place .pack2.$i.l -relwidth 1.0 -relheight 1.0 -} -test pack-6.12 {-expand option} { + [winfo geometry .pack.c] [winfo geometry .pack.d] +} -result {100x200+0+0 200x100+100+0 160x100+140+100 40x100+100+100} + +test pack-6.12 {-expand option} -setup { + toplevel .pack2 -height 400 -width 400 + wm geometry .pack2 +0+0 + pack propagate .pack2 0 + foreach i {w1 w2 w3} { + frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised + label .pack2.$i.l -text $i + place .pack2.$i.l -relwidth 1.0 -relheight 1.0 + } +} -body { pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 -ipady 6 -expand 1 -side left update list [winfo geometry .pack2.w1] [winfo geometry .pack2.w2] [winfo geometry .pack2.w3] -} {38x42+47+179 38x42+180+179 38x42+314+179} -test pack-6.13 {-expand option} { - pack forget .pack2.w1 .pack2.w2 .pack2.w3 +} -cleanup { + destroy .pack2 +} -result {38x42+47+179 38x42+180+179 38x42+314+179} +test pack-6.13 {-expand option} -setup { + toplevel .pack2 -height 400 -width 400 + wm geometry .pack2 +0+0 + pack propagate .pack2 0 + foreach i {w1 w2 w3} { + frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised + label .pack2.$i.l -text $i + place .pack2.$i.l -relwidth 1.0 -relheight 1.0 + } +} -body { pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 \ - -ipady 6 -expand 1 -side top + -ipady 6 -expand 1 -side top update list [winfo geometry .pack2.w1] [winfo geometry .pack2.w2] [winfo geometry .pack2.w3] -} {38x42+181+45 38x42+181+178 38x42+181+312} -catch {destroy .pack2} +} -cleanup { + destroy .pack2 +} -result {38x42+181+45 38x42+181+178 38x42+181+312} + wm geometry .pack {} -test pack-7.1 {requesting size for parent} { +test pack-7.1 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side left -padx 5 -pady 10 update list [winfo reqwidth .pack] [winfo reqheight .pack] -} {230 100} -test pack-7.2 {requesting size for parent} { +} -result {230 100} +test pack-7.2 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top -padx 5 -pady 10 update list [winfo reqwidth .pack] [winfo reqheight .pack] -} {90 260} -test pack-7.3 {requesting size for parent} { +} -result {90 260} +test pack-7.3 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side right -padx 5 -pady 10 update list [winfo reqwidth .pack] [winfo reqheight .pack] -} {230 100} -test pack-7.4 {requesting size for parent} { +} -result {230 100} +test pack-7.4 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side bottom -padx 5 -pady 10 update list [winfo reqwidth .pack] [winfo reqheight .pack] -} {90 260} -test pack-7.5 {requesting size for parent} { +} -result {90 260} +test pack-7.5 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side top -padx 5 -pady 10 pack .pack.b -side right -padx 5 -pady 10 pack .pack.c -side bottom -padx 5 -pady 10 pack .pack.d -side left -padx 5 -pady 10 update list [winfo reqwidth .pack] [winfo reqheight .pack] -} {150 210} -test pack-7.6 {requesting size for parent} { +} -result {150 210} +test pack-7.6 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side top pack .pack.c -side left pack .pack.d -side bottom update list [winfo reqwidth .pack] [winfo reqheight .pack] -} {120 120} -test pack-7.7 {requesting size for parent} { +} -result {120 120} +test pack-7.7 {requesting size for parent} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side right pack .pack.c -side bottom pack .pack.d -side top update list [winfo reqwidth .pack] [winfo reqheight .pack] -} {100 110} +} -result {100 110} # For the tests below, create a couple of "pad" windows to shrink @@ -468,363 +807,496 @@ pack .pack.right -side right pack .pack.bottom -side bottom pack .pack.a .pack.b .pack.c -side top update -test pack-8.1 {insufficient space} { +test pack-8.1 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x40+30+0 1 50x30+15+40 1 80x80+0+70 1} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x40+30+0 1 50x30+15+40 1 80x80+0+70 1} wm geom .pack 270x250 update -test pack-8.2 {insufficient space} { +test pack-8.2 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x40+25+0 1 50x30+10+40 1 70x30+0+70 1} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x40+25+0 1 50x30+10+40 1 70x30+0+70 1} wm geom .pack 240x220 update -test pack-8.3 {insufficient space} { +test pack-8.3 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x40+10+0 1 40x30+0+40 1 70x30+0+70 0} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x40+10+0 1 40x30+0+40 1 70x30+0+70 0} wm geom .pack 350x350 update -test pack-8.4 {insufficient space} { +test pack-8.4 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x40+65+0 1 50x30+50+40 1 80x80+35+70 1} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x40+65+0 1 50x30+50+40 1 80x80+35+70 1} wm geom .pack {} pack .pack.a -side left pack .pack.b -side right pack .pack.c -side left update -test pack-8.5 {insufficient space} { +test pack-8.5 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1} wm geom .pack 320x180 update -test pack-8.6 {insufficient space} { +test pack-8.6 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x30+0+0 1 50x30+70+0 1 50x30+20+0 1} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x30+0+0 1 50x30+70+0 1 50x30+20+0 1} wm geom .pack 250x180 update -test pack-8.7 {insufficient space} { +test pack-8.7 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x30+0+0 1 30x30+20+0 1 50x30+20+0 0} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x30+0+0 1 30x30+20+0 1 50x30+20+0 0} pack forget .pack.b update -test pack-8.8 {insufficient space} { +test pack-8.8 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x30+0+0 1 30x30+20+0 0 30x30+20+0 1} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x30+0+0 1 30x30+20+0 0 30x30+20+0 1} pack .pack.b -side right -after .pack.a wm geom .pack {} update -test pack-8.9 {insufficient space} { +test pack-8.9 {insufficient space} -body { list [winfo geometry .pack.a] [winfo ismapped .pack.a] \ - [winfo geometry .pack.b] [winfo ismapped .pack.b] \ - [winfo geometry .pack.c] [winfo ismapped .pack.c] -} {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1} + [winfo geometry .pack.b] [winfo ismapped .pack.b] \ + [winfo geometry .pack.c] [winfo ismapped .pack.c] +} -result {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1} pack forget .pack.right .pack.bottom -test pack-9.1 {window ordering} { + +test pack-9.1 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top pack .pack.a -after .pack.b pack slaves .pack -} {.pack.b .pack.a .pack.c .pack.d} -test pack-9.2 {window ordering} { +} -result {.pack.b .pack.a .pack.c .pack.d} +test pack-9.2 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top pack .pack.a -after .pack.a pack slaves .pack -} {.pack.a .pack.b .pack.c .pack.d} -test pack-9.3 {window ordering} { +} -result {.pack.a .pack.b .pack.c .pack.d} +test pack-9.3 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top pack .pack.a -before .pack.d pack slaves .pack -} {.pack.b .pack.c .pack.a .pack.d} -test pack-9.4 {window ordering} { +} -result {.pack.b .pack.c .pack.a .pack.d} +test pack-9.4 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top pack .pack.d -before .pack.a pack slaves .pack -} {.pack.d .pack.a .pack.b .pack.c} -test pack-9.5 {window ordering} { +} -result {.pack.d .pack.a .pack.b .pack.c} +test pack-9.5 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top pack propagate .pack.c 0 pack .pack.a -in .pack.c list [pack slaves .pack] [pack slaves .pack.c] -} {{.pack.b .pack.c .pack.d} .pack.a} -test pack-9.6 {window ordering} { +} -result {{.pack.b .pack.c .pack.d} .pack.a} +test pack-9.6 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top pack .pack.a -in .pack pack slaves .pack -} {.pack.b .pack.c .pack.d .pack.a} -test pack-9.7 {window ordering} { +} -result {.pack.b .pack.c .pack.d .pack.a} +test pack-9.7 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d -side top pack .pack.a -padx 0 pack slaves .pack -} {.pack.a .pack.b .pack.c .pack.d} -test pack-9.8 {window ordering} { +} -result {.pack.a .pack.b .pack.c .pack.d} +test pack-9.8 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c pack .pack.d pack slaves .pack -} {.pack.a .pack.b .pack.c .pack.d} -test pack-9.9 {window ordering} { +} -result {.pack.a .pack.b .pack.c .pack.d} +test pack-9.9 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d pack .pack.b .pack.d .pack.c -before .pack.a pack slaves .pack -} {.pack.b .pack.d .pack.c .pack.a} -test pack-9.10 {window ordering} { +} -result {.pack.b .pack.d .pack.c .pack.a} +test pack-9.10 {window ordering} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d pack .pack.a .pack.c .pack.d .pack.b -after .pack.a pack slaves .pack -} {.pack.a .pack.c .pack.d .pack.b} +} -result {.pack.a .pack.c .pack.d .pack.b} + -test pack-10.1 {retaining/clearing configuration state} { +test pack-10.1 {retaining/clearing configuration state} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side bottom -anchor n -padx 1 -pady 2 -ipadx 3 -ipady 4 \ - -fill both -expand 1 + -fill both -expand 1 pack forget .pack.a pack .pack.a pack info .pack.a -} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} -test pack-10.2 {retaining/clearing configuration state} { +} -result {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} +test pack-10.2 {retaining/clearing configuration state} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a -side bottom -anchor n -padx 1 -pady 2 -ipadx 3 -ipady 4 \ - -fill both -expand 1 + -fill both -expand 1 pack .pack.a -pady 14 pack info .pack.a -} {-in .pack -anchor n -expand 1 -fill both -ipadx 3 -ipady 4 -padx 1 -pady 14 -side bottom} -test pack-10.3 {bad -in window does not change master} { +} -result {-in .pack -anchor n -expand 1 -fill both -ipadx 3 -ipady 4 -padx 1 -pady 14 -side bottom} +test pack-10.3 {bad -in window does not change master} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [winfo manager .pack.a] \ - [catch {pack .pack.a -in .pack.a} err] $err \ - [winfo manager .pack.a] -} {{} 1 {can't pack .pack.a inside itself} {}} +} -body { + set result [list [winfo manager .pack.a]] + catch {pack .pack.a -in .pack.a} + lappend result [winfo manager .pack.a] +} -result {{} {}} +test pack-10.4 {bad -in window does not change master} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + winfo manager .pack.a + pack .pack.a -in .pack.a +} -returnCodes error -result {can't pack .pack.a inside itself} -test pack-11.1 {info option} { - pack4 -in .pack -} .pack -test pack-11.2 {info option} { - pack4 -anchor n -} n -test pack-11.3 {info option} { - pack4 -anchor sw -} sw -test pack-11.4 {info option} { - pack4 -expand yes -} 1 -test pack-11.5 {info option} { - pack4 -expand no -} 0 -test pack-11.6 {info option} { - pack4 -fill x -} x -test pack-11.7 {info option} { - pack4 -fill y -} y -test pack-11.8 {info option} { - pack4 -fill both -} both -test pack-11.9 {info option} { - pack4 -fill none -} none -test pack-11.10 {info option} { - pack4 -ipadx 14 -} 14 -test pack-11.11 {info option} { - pack4 -ipady 22 -} 22 -test pack-11.12 {info option} { - pack4 -padx 2 -} 2 -test pack-11.12.1 {info option} { - pack4 -padx {2 9} -} {2 9} -test pack-11.13 {info option} { - pack4 -pady 3 -} 3 -test pack-11.13.1 {info option} { - pack4 -pady {3 11} -} {3 11} -test pack-11.14 {info option} { - pack4 -side top -} top -test pack-11.15 {info option} { - pack4 -side bottom -} bottom -test pack-11.16 {info option} { - pack4 -side left -} left -test pack-11.17 {info option} { - pack4 -side right -} right -test pack-12.1 {command options and errors} { - list [catch {pack} msg] $msg -} {1 {wrong # args: should be "pack option arg ?arg ...?"}} -test pack-12.2 {command options and errors} { - list [catch {pack foo} msg] $msg -} {1 {wrong # args: should be "pack option arg ?arg ...?"}} -test pack-12.3 {command options and errors} { - list [catch {pack configure x} msg] $msg -} {1 {bad argument "x": must be name of window}} -test pack-12.4 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - pack configure .pack.b .pack.c - pack slaves .pack -} {.pack.b .pack.c} -test pack-12.5 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .foo} msg] $msg -} {1 {bad window path name ".foo"}} -test pack-12.6 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack} msg] $msg -} {1 {can't pack ".pack": it's a top-level window}} -test pack-12.7 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -after .foo} msg] $msg -} {1 {bad window path name ".foo"}} -test pack-12.8 {command options and errors} { +test pack-11.1 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -after .pack.b} msg] $msg -} {1 {window ".pack.b" isn't packed}} -test pack-12.9 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -anchor gorp} msg] $msg -} {1 {bad anchor "gorp": must be n, ne, e, se, s, sw, w, nw, or center}} -test pack-12.10 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -before gorp} msg] $msg -} {1 {bad window path name "gorp"}} -test pack-12.11 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -before .pack.b} msg] $msg -} {1 {window ".pack.b" isn't packed}} -test pack-12.12 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -expand "who cares?"} msg] $msg -} {1 {expected boolean value but got "who cares?"}} -test pack-12.13 {command options and errors} { +} -body { + pack .pack.a -in .pack + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -in]+1] +} -result .pack +test pack-11.2 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -fill z} msg] $msg -} {1 {bad fill style "z": must be none, x, y, or both}} -test pack-12.14 {command options and errors} { +} -body { + pack .pack.a -anchor n + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -anchor]+1] +} -result n +test pack-11.3 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -in z} msg] $msg -} {1 {bad window path name "z"}} -set pad [winfo pixels .pack 1c] -test pack-12.15 {command options and errors} { +} -body { + pack .pack.a -anchor sw + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -anchor]+1] +} -result sw +test pack-11.4 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -padx abc} msg] $msg -} {1 {bad pad value "abc": must be positive screen distance}} -test pack-12.15.1 {command options and errors} { +} -body { + pack .pack.a -expand yes + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -expand]+1] +} -result 1 +test pack-11.5 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -padx {5 abc}} msg] $msg -} {1 {bad 2nd pad value "abc": must be positive screen distance}} -test pack-12.16 {command options and errors} { +} -body { + pack .pack.a -expand no + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -expand]+1] +} -result 0 +test pack-11.6 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -padx -1} msg] $msg -} {1 {bad pad value "-1": must be positive screen distance}} -test pack-12.16.1 {command options and errors} { +} -body { + pack .pack.a -fill x + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -fill]+1] +} -result x +test pack-11.7 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -padx {5 -1}} msg] $msg -} {1 {bad 2nd pad value "-1": must be positive screen distance}} -test pack-12.17 {command options and errors} { +} -body { + pack .pack.a -fill y + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -fill]+1] +} -result y +test pack-11.8 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -pady abc} msg] $msg -} {1 {bad pad value "abc": must be positive screen distance}} -test pack-12.17.1 {command options and errors} { +} -body { + pack .pack.a -fill both + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -fill]+1] +} -result both +test pack-11.9 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -pady {0 abc}} msg] $msg -} {1 {bad 2nd pad value "abc": must be positive screen distance}} -test pack-12.18 {command options and errors} { +} -body { + pack .pack.a -fill none + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -fill]+1] +} -result none +test pack-11.10 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -pady -1} msg] $msg -} {1 {bad pad value "-1": must be positive screen distance}} -test pack-12.18.1 {command options and errors} { +} -body { + pack .pack.a -ipadx 14 + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -ipadx]+1] +} -result 14 +test pack-11.11 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -pady {0 -1}} msg] $msg -} {1 {bad 2nd pad value "-1": must be positive screen distance}} -test pack-12.19 {command options and errors} { +} -body { + pack .pack.a -ipady 22 + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -ipady]+1] +} -result 22 +test pack-11.12 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -ipadx abc} msg] $msg -} {1 {bad ipadx value "abc": must be positive screen distance}} -test pack-12.20 {command options and errors} { +} -body { + pack .pack.a -padx 2 + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -padx]+1] +} -result 2 +test pack-11.13 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -ipadx -1} msg] $msg -} {1 {bad ipadx value "-1": must be positive screen distance}} -test pack-12.20.1 {command options and errors} { +} -body { + pack .pack.a -padx {2 9} + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -padx]+1] +} -result {2 9} +test pack-11.14 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -ipadx {5 5}} msg] $msg -} {1 {bad ipadx value "5 5": must be positive screen distance}} -test pack-12.21 {command options and errors} { +} -body { + pack .pack.a -pady 3 + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -pady]+1] +} -result 3 +test pack-11.15 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -ipady abc} msg] $msg -} {1 {bad ipady value "abc": must be positive screen distance}} -test pack-12.22 {command options and errors} { +} -body { + pack .pack.a -pady {3 11} + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -pady]+1] +} -result {3 11} +test pack-11.16 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -ipady -1} msg] $msg -} {1 {bad ipady value "-1": must be positive screen distance}} -test pack-12.22.1 {command options and errors} { +} -body { + pack .pack.a -side top + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -side]+1] +} -result top +test pack-11.17 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -ipady {5 5}} msg] $msg -} {1 {bad ipady value "5 5": must be positive screen distance}} -test pack-12.23 {command options and errors} { +} -body { + pack .pack.a -side bottom + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -side]+1] +} -result bottom +test pack-11.18 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -side bac} msg] $msg -} {1 {bad side "bac": must be top, bottom, left, or right}} -test pack-12.24 {command options and errors} { +} -body { + pack .pack.a -side left + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -side]+1] +} -result left +test pack-11.19 {info option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -lousy bac} msg] $msg -} {1 {bad option "-lousy": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}} -test pack-12.25 {command options and errors} { +} -body { + pack .pack.a -side right + set i [pack info .pack.a] + lindex $i [expr [lsearch -exact $i -side]+1] +} -result right + + +test pack-12.1 {command options and errors} -body { + pack +} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} +test pack-12.2 {command options and errors} -body { + pack foo +} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} +test pack-12.3 {command options and errors} -body { + pack configure x +} -returnCodes error -result {bad argument "x": must be name of window} +test pack-12.4 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack configure .pack.b .pack.c + pack slaves .pack +} -result {.pack.b .pack.c} +test pack-12.5 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -padx} msg] $msg -} {1 {extra option "-padx" (option with no value?)}} -test pack-12.26 {command options and errors} { +} -body { + pack .foo +} -returnCodes error -result {bad window path name ".foo"} +test pack-12.6 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a ? 22} msg] $msg -} {1 {bad option "?": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}} -test pack-12.27 {command options and errors} { +} -body { + pack .pack +} -returnCodes error -result {can't pack ".pack": it's a top-level window} +test pack-12.7 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -in .} msg] $msg -} {1 {can't pack .pack.a inside .}} -test pack-12.28 {command options and errors} { +} -body { + pack .pack.a -after .foo +} -returnCodes error -result {bad window path name ".foo"} +test pack-12.8 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -after .pack.b +} -returnCodes error -result {window ".pack.b" isn't packed} +test pack-12.9 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -anchor gorp +} -returnCodes error -result {bad anchor "gorp": must be n, ne, e, se, s, sw, w, nw, or center} +test pack-12.10 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -before gorp +} -returnCodes error -result {bad window path name "gorp"} +test pack-12.11 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -before .pack.b +} -returnCodes error -result {window ".pack.b" isn't packed} +test pack-12.12 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -expand "who cares?" +} -returnCodes error -result {expected boolean value but got "who cares?"} +test pack-12.13 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -fill z +} -returnCodes error -result {bad fill style "z": must be none, x, y, or both} +test pack-12.14 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -in z +} -returnCodes error -result {bad window path name "z"} +set pad [winfo pixels .pack 1c] +test pack-12.15 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -padx abc +} -returnCodes error -result {bad pad value "abc": must be positive screen distance} +test pack-12.16 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -padx {5 abc} +} -returnCodes error -result {bad 2nd pad value "abc": must be positive screen distance} +test pack-12.17 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -padx -1 +} -returnCodes error -result {bad pad value "-1": must be positive screen distance} +test pack-12.18 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -padx {5 -1} +} -returnCodes error -result {bad 2nd pad value "-1": must be positive screen distance} +test pack-12.19 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -pady abc +} -returnCodes error -result {bad pad value "abc": must be positive screen distance} +test pack-12.20 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -pady {0 abc} +} -returnCodes error -result {bad 2nd pad value "abc": must be positive screen distance} +test pack-12.21 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -pady -1 +} -returnCodes error -result {bad pad value "-1": must be positive screen distance} +test pack-12.22 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -pady {0 -1} +} -returnCodes error -result {bad 2nd pad value "-1": must be positive screen distance} +test pack-12.23 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -ipadx abc +} -returnCodes error -result {bad ipadx value "abc": must be positive screen distance} +test pack-12.24 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -ipadx -1 +} -returnCodes error -result {bad ipadx value "-1": must be positive screen distance} +test pack-12.25 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -ipadx {5 5} +} -returnCodes error -result {bad ipadx value "5 5": must be positive screen distance} +test pack-12.26 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -ipady abc +} -returnCodes error -result {bad ipady value "abc": must be positive screen distance} +test pack-12.27 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -ipady -1 +} -returnCodes error -result {bad ipady value "-1": must be positive screen distance} +test pack-12.28 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -ipady {5 5} +} -returnCodes error -result {bad ipady value "5 5": must be positive screen distance} +test pack-12.29 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -side bac +} -returnCodes error -result {bad side "bac": must be top, bottom, left, or right} +test pack-12.30 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -lousy bac +} -returnCodes error -result {bad option "-lousy": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side} +test pack-12.31 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -padx +} -returnCodes error -result {extra option "-padx" (option with no value?)} +test pack-12.32 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a ? 22 +} -returnCodes error -result {bad option "?": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side} +test pack-12.33 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a -in . +} -returnCodes error -result {can't pack .pack.a inside .} +test pack-12.34 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { frame .pack.a.a - list [catch {pack .pack.a.a -in .pack.b} msg] $msg -} {1 {can't pack .pack.a.a inside .pack.b}} -test pack-12.29 {command options and errors} { + pack .pack.a.a -in .pack.b +} -returnCodes error -result {can't pack .pack.a.a inside .pack.b} +test pack-12.35 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack .pack.a -in .pack.a} msg] $msg -} {1 {can't pack .pack.a inside itself}} -test pack-12.30 {command options and errors} { +} -body { + pack .pack.a -in .pack.a +} -returnCodes error -result {can't pack .pack.a inside itself} +test pack-12.36 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a .pack.b .pack.c .pack.d pack forget .pack.a .pack.d pack slaves .pack -} {.pack.b .pack.c} -test pack-12.31 {command options and errors} { +} -result {.pack.b .pack.c} +test pack-12.37 {command options and errors} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { .pack configure -width 300 -height 200 pack propagate .pack 0 pack .pack.a @@ -833,63 +1305,77 @@ test pack-12.31 {command options and errors} { pack propagate .pack 1 update lappend result [winfo reqwidth .pack] [winfo reqheight .pack] - set result -} {300 200 20 40} -test pack-12.32 {command options and errors} { + return $result +} -result {300 200 20 40} +test pack-12.38 {command options and errors} -body { set result [pack propagate .pack.d] pack propagate .pack.d 0 lappend result [pack propagate .pack.d] pack propagate .pack.d 1 lappend result [pack propagate .pack.d] - set result -} {1 0 1} -test pack-12.33 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack propagate .dum} msg] $msg -} {1 {bad window path name ".dum"}} -test pack-12.34 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack propagate .pack foo} msg] $msg -} {1 {expected boolean value but got "foo"}} -test pack-12.35 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack propagate .pack foo bar} msg] $msg -} {1 {wrong # args: should be "pack propagate window ?boolean?"}} -test pack-12.36 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack slaves} msg] $msg -} {1 {wrong # args: should be "pack option arg ?arg ...?"}} -test pack-12.37 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack slaves a b} msg] $msg -} {1 {wrong # args: should be "pack slaves window"}} -test pack-12.38 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack slaves .x} msg] $msg -} {1 {bad window path name ".x"}} -test pack-12.39 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack slaves .pack.a} msg] $msg -} {0 {}} -test pack-12.40 {command options and errors} { - pack forget .pack.a .pack.b .pack.c .pack.d - list [catch {pack lousy .pack} msg] $msg -} {1 {bad option "lousy": must be configure, forget, info, propagate, or slaves}} + return $result +} -result {1 0 1} +test pack-12.39 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack propagate .dum +} -returnCodes error -result {bad window path name ".dum"} +test pack-12.40 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack propagate .pack foo +} -returnCodes error -result {expected boolean value but got "foo"} +test pack-12.41 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack propagate .pack foo bar +} -returnCodes error -result {wrong # args: should be "pack propagate window ?boolean?"} +test pack-12.42 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack slaves +} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} +test pack-12.43 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack slaves a b +} -returnCodes error -result {wrong # args: should be "pack slaves window"} +test pack-12.44 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack slaves .x +} -returnCodes error -result {bad window path name ".x"} +test pack-12.45 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack slaves .pack.a +} -returnCodes ok -result {} +test pack-12.46 {command options and errors} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack lousy .pack +} -returnCodes error -result {bad option "lousy": must be configure, forget, info, propagate, or slaves} -pack .pack.right -side right -pack .pack.bottom -side bottom -test pack-13.1 {window deletion} { - pack forget .pack.a .pack.b .pack.c .pack.d + +test pack-13.1 {window deletion} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d .pack.right .pack.bottom +} -body { + pack .pack.right -side right + pack .pack.bottom -side bottom pack .pack.a .pack.d .pack.b .pack.c -side top update destroy .pack.d update set result [list [pack slaves .pack] [winfo geometry .pack.a] \ - [winfo geometry .pack.b] [winfo geometry .pack.c]] -} {{.pack.right .pack.bottom .pack.a .pack.b .pack.c} 20x40+30+0 50x30+15+40 80x80+0+70} + [winfo geometry .pack.b] [winfo geometry .pack.c]] +} -result {{.pack.right .pack.bottom .pack.a .pack.b .pack.c} 20x40+30+0 50x30+15+40 80x80+0+70} -test pack-14.1 {respond to changes in expansion} { - pack forget .pack.a .pack.b .pack.c .pack.d + +test pack-14.1 {respond to changes in expansion} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d .pack.right .pack.bottom +} -body { + pack .pack.right -side right + pack .pack.bottom -side bottom wm geom .pack {} pack .pack.a update @@ -900,11 +1386,15 @@ test pack-14.1 {respond to changes in expansion} { pack .pack.a -expand true -fill both update lappend result [winfo geom .pack.a] -} {20x40+0+0 20x40+90+0 200x150+0+0} -wm geom .pack {} +} -cleanup { + wm geom .pack {} +} -result {20x40+0+0 20x40+90+0 200x150+0+0} -test pack-15.1 {managing geometry with -in option} { + +test pack-15.1 {managing geometry with -in option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d + destroy .pack.f +} -body { pack .pack.a -side top frame .pack.f lower .pack.f @@ -918,10 +1408,13 @@ test pack-15.1 {managing geometry with -in option} { pack unpack .pack.a update lappend result [winfo geom .pack.b] -} {50x30+0+40 50x30+0+0} -catch {destroy .pack.f} -test pack-15.2 {managing geometry with -in option} { +} -cleanup { + destroy .pack.f +} -result {50x30+0+40 50x30+0+0} +test pack-15.2 {managing geometry with -in option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d + destroy .pack.f +} -body { frame .pack.f lower .pack.f pack .pack.a -in .pack.f -side top @@ -933,10 +1426,13 @@ test pack-15.2 {managing geometry with -in option} { place forget .pack.f update lappend result [winfo ismapped .pack.a] -} {0 1 20x40+30+45 0} -catch {destroy .pack.f} -test pack-15.3 {managing geometry with -in option} { +} -cleanup { + destroy .pack.f +} -result {0 1 20x40+30+45 0} +test pack-15.3 {managing geometry with -in option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d + destroy .pack.f +} -body { pack .pack.a -side top frame .pack.f lower .pack.f @@ -950,15 +1446,18 @@ test pack-15.3 {managing geometry with -in option} { pack unpack .pack.f update lappend result [winfo ismapped .pack.b] -} {1 0} -catch {destroy .pack.f} -test pack-15.4 {managing geometry with -in option} { +} -cleanup { + destroy .pack.f +} -result {1 0} +test pack-15.4 {managing geometry with -in option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d + destroy .pack.f1 .pack.f2 +} -body { foreach i {1 2} { - frame .pack.f$i -width 100 -height 40 -bd 2 -relief raised - lower .pack.f$i - pack propagate .pack.f$i 0 - pack .pack.f$i -side top + frame .pack.f$i -width 100 -height 40 -bd 2 -relief raised + lower .pack.f$i + pack propagate .pack.f$i 0 + pack .pack.f$i -side top } pack .pack.b -in .pack.f1 -side right update @@ -973,15 +1472,18 @@ test pack-15.4 {managing geometry with -in option} { pack forget .pack.b update lappend result [winfo geometry .pack.b] [winfo ismapped .pack.b] -} {50x30+48+5 1 50x30+25+48 1 50x30+25+28 1 50x30+25+28 0} -catch {destroy .pack.f1 .pack.f2} -test pack-15.5 {managing geometry with -in option} { +} -cleanup { + destroy .pack.f1 .pack.f2 +} -result {50x30+48+5 1 50x30+25+48 1 50x30+25+28 1 50x30+25+28 0} +test pack-15.5 {managing geometry with -in option} -setup { pack forget .pack.a .pack.b .pack.c .pack.d + destroy .pack.f1 .pack.f2 +} -body { foreach i {1 2} { - frame .pack.f$i -width 100 -height 20 -bd 2 -relief raised - lower .pack.f$i - pack propagate .pack.f$i 0 - pack .pack.f$i -side top + frame .pack.f$i -width 100 -height 20 -bd 2 -relief raised + lower .pack.f$i + pack propagate .pack.f$i 0 + pack .pack.f$i -side top } pack .pack.b -in .pack.f2 -side top update @@ -990,30 +1492,50 @@ test pack-15.5 {managing geometry with -in option} { pack .pack.a -before .pack.b -side top update lappend result [winfo geometry .pack.b] [winfo ismapped .pack.b] -} {50x16+25+22 1 50x16+25+22 0} -catch {destroy .pack.f1 .pack.f2} +} -cleanup { + destroy .pack.f1 .pack.f2 +} -result {50x16+25+22 1 50x16+25+22 0} + -test pack-16.1 {geometry manager name} { +test pack-16.1 {geometry manager name} -setup { pack forget .pack.a .pack.b .pack.c .pack.d set result {} +} -body { lappend result [winfo manager .pack.a] pack .pack.a lappend result [winfo manager .pack.a] pack forget .pack.a lappend result [winfo manager .pack.a] -} {{} pack {}} +} -result {{} pack {}} + -test pack-17.1 {PackLostSlaveProc procedure} { +test pack-17.1 {PackLostSlaveProc procedure} -setup { pack forget .pack.a .pack.b .pack.c .pack.d +} -body { pack .pack.a update place .pack.a -x 40 -y 10 update - list [winfo manager .pack.a] [winfo geometry .pack.a] \ - [catch {pack info .pack.a} msg] $msg -} {place 20x40+40+10 1 {window ".pack.a" isn't packed}} + list [winfo manager .pack.a] [winfo geometry .pack.a] +} -result {place 20x40+40+10} +test pack-17.2 {PackLostSlaveProc procedure} -setup { + pack forget .pack.a .pack.b .pack.c .pack.d +} -body { + pack .pack.a + update + place .pack.a -x 40 -y 10 + update + winfo manager .pack.a + winfo geometry .pack.a + pack info .pack.a +} -returnCodes error -result {window ".pack.a" isn't packed} + -test pack-18.1 {unmap slaves when master unmapped} {tempNotPc} { +test pack-18.1 {unmap slaves when master unmapped} -constraints { + tempNotPc +} -setup { + eval destroy [winfo child .pack] +} -body { # adjust the position of .pack before test to avoid a screen switch # that occurs with window managers that have desktops four times as big @@ -1036,19 +1558,20 @@ test pack-18.1 {unmap slaves when master unmapped} {tempNotPc} { .pack.a configure -width 200 -height 75 update lappend result [winfo width .pack.a ] [winfo height .pack.a] \ - [winfo ismapped .pack.a] + [winfo ismapped .pack.a] wm deiconify .pack update lappend result [winfo ismapped .pack.a] -} {1 0 200 75 0 1} -test pack-18.2 {unmap slaves when master unmapped} { +} -result {1 0 200 75 0 1} +test pack-18.2 {unmap slaves when master unmapped} -setup { + eval destroy [winfo child .pack] +} -body { # adjust the position of .pack before test to avoid a screen switch # that occurs with window managers that have desktops four times as big # as the screen (screen switch causes scale and other tests to fail). wm geometry .pack +100+100 - eval destroy [winfo child .pack] frame .pack.a -relief raised -bd 2 frame .pack.b -width 70 -height 30 -relief sunken -bd 2 pack .pack.a @@ -1061,15 +1584,17 @@ test pack-18.2 {unmap slaves when master unmapped} { .pack.b configure -width 100 -height 30 update lappend result [winfo width .pack.b ] [winfo height .pack.b] \ - [winfo ismapped .pack.b] + [winfo ismapped .pack.b] wm deiconify .pack update lappend result [winfo ismapped .pack.b] -} {1 0 100 30 0 1} +} -result {1 0 100 30 0 1} + -test pack-19.1 {test respect for internalborder} { +test pack-19.1 {test respect for internalborder} -setup { catch {eval pack forget [pack slaves .pack]} destroy .pack.l .pack.lf +} -body { wm geometry .pack 200x200 frame .pack.l -width 15 -height 10 labelframe .pack.lf -labelwidget .pack.l @@ -1081,12 +1606,13 @@ test pack-19.1 {test respect for internalborder} { .pack.lf configure -labelanchor e -padx 3 -pady 5 update lappend res [winfo geometry .pack.lf.f] +} -cleanup { destroy .pack.l .pack.lf - set res -} {196x188+2+10 177x186+5+7} -test pack-19.2 {test support for minreqsize} { +} -result {196x188+2+10 177x186+5+7} +test pack-19.2 {test support for minreqsize} -setup { catch {eval pack forget [pack slaves .pack]} destroy .pack.l .pack.lf +} -body { wm geometry .pack {} frame .pack.l -width 150 -height 100 labelframe .pack.lf -labelwidget .pack.l @@ -1098,15 +1624,14 @@ test pack-19.2 {test support for minreqsize} { .pack.lf configure -labelanchor ws update lappend res [winfo geometry .pack.lf] +} -cleanup { destroy .pack.l .pack.lf - set res -} {162x127+0+0 172x112+0+0} +} -result {162x127+0+0 172x112+0+0} -destroy .pack -foreach i {pack1 pack2 pack3 pack4} { - rename $i {} -} # cleanup cleanupTests return + + + diff --git a/tests/panedwindow.test b/tests/panedwindow.test index d3ae53b..ec48f1e 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -6,125 +6,314 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: panedwindow.test,v 1.22 2007/12/13 15:27:54 dgp Exp $ +# RCS: @(#) $Id: panedwindow.test,v 1.23 2008/08/21 11:19:33 aniap Exp $ -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 {-orient - horizontal horizontal - badValue {bad orient "badValue": must be horizontal or vertical}} - panedwindow-1.10 {-relief - groove groove - 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.11 {-sashcursor - arrow arrow badValue {bad cursor spec "badValue"}} - panedwindow-1.12 {-sashpad - 1.3 1 badValue {bad screen distance "badValue"}} - panedwindow-1.13 {-sashrelief - groove groove - 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.14 {-sashwidth - 10 10 badValue {bad screen distance "badValue"}} - panedwindow-1.15 {-showhandle - true 1 foo {expected boolean value but got "foo"}} - panedwindow-1.16 {-width - 402 402 badValue {bad screen distance "badValue"}} -} { - lassign $testData optionName goodIn goodOut badIn badOut - test ${testName}(good) "configuration options: $optionName" { - .p configure $optionName $goodIn - list [lindex [.p configure $optionName] 4] [.p cget $optionName] - } [list $goodOut $goodOut] - test ${testName}(bad) "configuration options: $optionName" -body { - .p configure $optionName $badIn - } -returnCodes error -result $badOut - # Reset to default - .p configure $optionName [lindex [.p configure $optionName] 3] -} +# 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: -relief (good)} -body { + .p configure -relief groove + list [lindex [.p configure -relief] 4] [.p cget -relief] +} -cleanup { + .p configure -relief [lindex [.p configure -relief] 3] +} -result {groove groove} +test panedwindow-1.20 {configuration options: -relief (bad)} -body { + .p configure -relief 1.5 +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test panedwindow-1.21 {configuration options: -sashcursor (good)} -body { + .p configure -sashcursor arrow + list [lindex [.p configure -sashcursor] 4] [.p cget -sashcursor] +} -cleanup { + .p configure -sashcursor [lindex [.p configure -sashcursor] 3] +} -result {arrow arrow} +test panedwindow-1.22 {configuration options: -sashcursor (bad)} -body { + .p configure -sashcursor badValue +} -returnCodes error -result {bad cursor spec "badValue"} +test panedwindow-1.23 {configuration options: -sashpad (good)} -body { + .p configure -sashpad 1.3 + list [lindex [.p configure -sashpad] 4] [.p cget -sashpad] +} -cleanup { + .p configure -sashpad [lindex [.p configure -sashpad] 3] +} -result {1 1} +test panedwindow-1.24 {configuration options: -sashpad (bad)} -body { + .p configure -sashpad badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.25 {configuration options: -sashrelief (good)} -body { + .p configure -sashrelief groove + list [lindex [.p configure -sashrelief] 4] [.p cget -sashrelief] +} -cleanup { + .p configure -sashrelief [lindex [.p configure -sashrelief] 3] +} -result {groove groove} +test panedwindow-1.26 {configuration options: -sashrelief (bad)} -body { + .p configure -sashrelief 1.5 +} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test panedwindow-1.27 {configuration options: -sashwidth (good)} -body { + .p configure -sashwidth 10 + list [lindex [.p configure -sashwidth] 4] [.p cget -sashwidth] +} -cleanup { + .p configure -sashwidth [lindex [.p configure -sashwidth] 3] +} -result {10 10} +test panedwindow-1.28 {configuration options: -sashwidth (bad)} -body { + .p configure -sashwidth badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.29 {configuration options: -showhandle (good)} -body { + .p configure -showhandle true + list [lindex [.p configure -showhandle] 4] [.p cget -showhandle] +} -cleanup { + .p configure -showhandle [lindex [.p configure -showhandle] 3] +} -result {1 1} +test panedwindow-1.30 {configuration options: -showhandle (bad)} -body { + .p configure -showhandle foo +} -returnCodes error -result {expected boolean value but got "foo"} +test panedwindow-1.31 {configuration options: -width (good)} -body { + .p configure -width 402 + list [lindex [.p configure -width] 4] [.p cget -width] +} -cleanup { + .p configure -width [lindex [.p configure -width] 3] +} -result {402 402} +test panedwindow-1.32 {configuration options: -width (bad)} -body { + .p configure -width badValue +} -returnCodes error -result {bad screen distance "badValue"} + +test panedwindow-1.33 {configuration options: -after (good)} -body { + .p paneconfigure .b -after .c + list [lindex [.p paneconfigure .b -after] 4] \ + [.p panecget .b -after] +} -cleanup { + .p paneconfig .b -after [lindex [.p paneconfig .b -after] 3] +} -result {.c .c} +test panedwindow-1.34 {configuration options: -after (bad)} -body { + .p paneconfigure .b -after badValue +} -returnCodes error -result {bad window path name "badValue"} +test panedwindow-1.35 {configuration options: -before (good)} -body { + .p paneconfigure .b -before .c + list [lindex [.p paneconfigure .b -before] 4] \ + [.p panecget .b -before] +} -cleanup { + .p paneconfig .b -before [lindex [.p paneconfig .b -before] 3] +} -result {.c .c} +test panedwindow-1.36 {configuration options: -before (bad)} -body { + .p paneconfigure .b -before badValue +} -returnCodes error -result {bad window path name "badValue"} +test panedwindow-1.37 {configuration options: -height (good)} -body { + .p paneconfigure .b -height 10 + list [lindex [.p paneconfigure .b -height] 4] \ + [.p panecget .b -height] +} -cleanup { + .p paneconfig .b -height [lindex [.p paneconfig .b -height] 3] +} -result {10 10} +test panedwindow-1.38 {configuration options: -height (bad)} -body { + .p paneconfigure .b -height badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.39 {configuration options: -hide (good)} -body { + .p paneconfigure .b -hide false + list [lindex [.p paneconfigure .b -hide] 4] \ + [.p panecget .b -hide] +} -cleanup { + .p paneconfig .b -hide [lindex [.p paneconfig .b -hide] 3] +} -result {0 0} +test panedwindow-1.40 {configuration options: -hide (bad)} -body { + .p paneconfigure .b -hide foo +} -returnCodes error -result {expected boolean value but got "foo"} +test panedwindow-1.41 {configuration options: -minsize (good)} -body { + .p paneconfigure .b -minsize 10 + list [lindex [.p paneconfigure .b -minsize] 4] \ + [.p panecget .b -minsize] +} -cleanup { + .p paneconfig .b -minsize [lindex [.p paneconfig .b -minsize] 3] +} -result {10 10} +test panedwindow-1.42 {configuration options: -minsize (bad)} -body { + .p paneconfigure .b -minsize badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.43 {configuration options: -padx (good)} -body { + .p paneconfigure .b -padx 1.3 + list [lindex [.p paneconfigure .b -padx] 4] \ + [.p panecget .b -padx] +} -cleanup { + .p paneconfig .b -padx [lindex [.p paneconfig .b -padx] 3] +} -result {1 1} +test panedwindow-1.44 {configuration options: -padx (bad)} -body { + .p paneconfigure .b -padx badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.45 {configuration options: -pady (good)} -body { + .p paneconfigure .b -pady 1.3 + list [lindex [.p paneconfigure .b -pady] 4] \ + [.p panecget .b -pady] +} -cleanup { + .p paneconfig .b -pady [lindex [.p paneconfig .b -pady] 3] +} -result {1 1} +test panedwindow-1.46 {configuration options: -pady (bad)} -body { + .p paneconfigure .b -pady badValue +} -returnCodes error -result {bad screen distance "badValue"} +test panedwindow-1.47 {configuration options: -sticky (good)} -body { + .p paneconfigure .b -sticky nsew + list [lindex [.p paneconfigure .b -sticky] 4] \ + [.p panecget .b -sticky] +} -cleanup { + .p paneconfig .b -sticky [lindex [.p paneconfig .b -sticky] 3] +} -result {nesw nesw} +test panedwindow-1.48 {configuration options: -sticky (bad)} -body { + .p paneconfigure .b -sticky abcd +} -returnCodes error -result {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w} +test panedwindow-1.49 {configuration options: -stretch (good)} -body { + .p paneconfigure .b -stretch alw + list [lindex [.p paneconfigure .b -stretch] 4] \ + [.p panecget .b -stretch] +} -cleanup { + .p paneconfig .b -stretch [lindex [.p paneconfig .b -stretch] 3] +} -result {always always} +test panedwindow-1.50 {configuration options: -stretch (bad)} -body { + .p paneconfigure .b -stretch foo +} -returnCodes error -result {bad stretch "foo": must be always, first, last, middle, or never} +test panedwindow-1.51 {configuration options: -width (good)} -body { + .p paneconfigure .b -width 10 + list [lindex [.p paneconfigure .b -width] 4] \ + [.p panecget .b -width] +} -cleanup { + .p paneconfig .b -width [lindex [.p paneconfig .b -width] 3] +} -result {10 10} +test panedwindow-1.52 {configuration options: -width (bad)} -body { + .p paneconfigure .b -width badValue +} -returnCodes error -result {bad screen distance "badValue"} +deleteWindows + + +test panedwindow-2.1 {panedwindow widget command} -setup { + deleteWindows +} -body { + panedwindow .p + .p foo +} -cleanup { + deleteWindows +} -returnCodes error -result {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash} -test panedwindow-3.1 {panedwindow panes subcommand} { + +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] @@ -133,10 +322,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] @@ -145,317 +336,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 @@ -464,16 +739,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 @@ -481,11 +760,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] @@ -495,81 +774,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] @@ -577,11 +867,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] @@ -589,12 +881,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] @@ -604,36 +897,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 @@ -643,10 +945,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} { @@ -660,10 +965,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 @@ -672,10 +980,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 @@ -684,29 +994,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 @@ -715,10 +1031,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 @@ -727,10 +1045,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 @@ -739,20 +1059,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]} @@ -760,11 +1084,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]} @@ -774,32 +1099,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 @@ -809,56 +1136,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 @@ -871,33 +1501,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 @@ -908,17 +1536,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 @@ -929,121 +1556,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 @@ -1056,139 +1676,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 @@ -1201,35 +1814,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 @@ -1240,18 +1851,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 @@ -1262,129 +1872,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 @@ -1397,178 +2000,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} { @@ -1577,10 +2182,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} { @@ -1589,10 +2197,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} { @@ -1601,219 +2212,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 "" - 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 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 "" - 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 20} {0 40}} + +test panedwindow-19.14 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 53 20 20} {3 95 20 20}} +test panedwindow-19.15 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {22 20} + +test panedwindow-19.16 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {72 20} + +test panedwindow-19.17 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{23 0} {49 0}} + +test panedwindow-19.18 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}} + +test panedwindow-19.19 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 0 \ + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 22} + +test panedwindow-19.20 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 72} + +test panedwindow-19.21 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{0 23} {0 49}} + +test panedwindow-19.22 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}} +test panedwindow-19.23 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 20} + +test panedwindow-19.24 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {66 20} + +test panedwindow-19.25 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{20 0} {43 0}} + +test panedwindow-19.26 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{11 3 20 20} {56 3 20 20} {101 3 20 20}} + +test panedwindow-19.27 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 0 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 + .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 20} + +test panedwindow-19.28 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 66} + +test panedwindow-19.29 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{0 20} {0 43}} + +test panedwindow-19.30 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 56 20 20} {3 101 20 20}} +test panedwindow-19.31 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {22 20} + +test panedwindow-19.32 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {72 20} + +test panedwindow-19.33 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{21 0} {47 0}} + +test panedwindow-19.34 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}} + +test panedwindow-19.35 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 0 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 22} + +test panedwindow-19.36 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 72} + +test panedwindow-19.37 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{0 21} {0 47}} + +test panedwindow-19.38 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}} +test panedwindow-19.39 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 20} + +test panedwindow-19.40 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {80 20} + +test panedwindow-19.41 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{25 0} {55 0}} + +test panedwindow-19.42 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{11 3 20 20} {63 3 20 20} {115 3 20 20}} + +test panedwindow-19.43 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 0 + .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 20} + +test panedwindow-19.44 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 80} + +test panedwindow-19.45 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{0 25} {0 55}} + +test panedwindow-19.46 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 63 20 20} {3 115 20 20}} +test panedwindow-19.47 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {22 20} + +test panedwindow-19.48 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {92 20} + +test panedwindow-19.49 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{28 0} {64 0}} + +test panedwindow-19.50 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}} + +test panedwindow-19.51 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 22} + +test panedwindow-19.52 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 92} + +test panedwindow-19.53 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{0 28} {0 64}} + +test panedwindow-19.54 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}} +test panedwindow-19.55 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 20} + +test panedwindow-19.56 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {86 20} + +test panedwindow-19.57 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{25 0} {58 0}} + +test panedwindow-19.58 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{11 3 20 20} {66 3 20 20} {121 3 20 20}} + +test panedwindow-19.59 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 + .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 20} + +test panedwindow-19.60 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 86} + +test panedwindow-19.61 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{0 25} {0 58}} + +test panedwindow-19.62 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 66 20 20} {3 121 20 20}} +test panedwindow-19.63 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {22 20} + +test panedwindow-19.64 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {92 20} + +test panedwindow-19.65 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{26 0} {62 0}} + +test panedwindow-19.66 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}} + +test panedwindow-19.67 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 0 -sashpad 5 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 22} + +test panedwindow-19.68 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {20 92} + +test panedwindow-19.69 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{0 26} {0 62}} + +test panedwindow-19.70 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 0 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}} +test panedwindow-19.71 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.72 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {64 24} + +test panedwindow-19.73 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{22 2} {42 2}} + +test panedwindow-19.74 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {55 5 20 20} {97 5 20 20}} + +test panedwindow-19.75 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 0 + .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.76 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 64} + +test panedwindow-19.77 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 22} {2 42}} + +test panedwindow-19.78 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 55 20 20} {5 97 20 20}} +test panedwindow-19.79 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {26 24} + +test panedwindow-19.80 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {76 24} + +test panedwindow-19.81 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{25 2} {51 2}} + +test panedwindow-19.82 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}} + +test panedwindow-19.83 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 26} + +test panedwindow-19.84 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 76} + +test panedwindow-19.85 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 25} {2 51}} + +test panedwindow-19.86 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}} +test panedwindow-19.87 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.88 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {70 24} + +test panedwindow-19.89 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{22 2} {45 2}} + +test panedwindow-19.90 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {58 5 20 20} {103 5 20 20}} + +test panedwindow-19.91 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 + .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.92 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 70} + +test panedwindow-19.93 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 22} {2 45}} + +test panedwindow-19.94 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 58 20 20} {5 103 20 20}} +test panedwindow-19.95 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {26 24} + +test panedwindow-19.96 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {76 24} + +test panedwindow-19.97 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{23 2} {49 2}} + +test panedwindow-19.98 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}} + +test panedwindow-19.99 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 0 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 26} + +test panedwindow-19.100 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 76} + +test panedwindow-19.101 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 23} {2 49}} + +test panedwindow-19.102 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 0 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}} +test panedwindow-19.103 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.104 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {84 24} + +test panedwindow-19.105 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{27 2} {57 2}} + +test panedwindow-19.106 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {65 5 20 20} {117 5 20 20}} + +test panedwindow-19.107 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 0 + .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.108 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 84} + +test panedwindow-19.109 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 27} {2 57}} + +test panedwindow-19.110 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 65 20 20} {5 117 20 20}} +test panedwindow-19.111 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {26 24} + +test panedwindow-19.112 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {96 24} + +test panedwindow-19.113 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{30 2} {66 2}} + +test panedwindow-19.114 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}} + +test panedwindow-19.115 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -orient vertical -sashwidth 0 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 26} + +test panedwindow-19.116 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 96} + +test panedwindow-19.117 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 30} {2 66}} + +test panedwindow-19.118 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 0 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}} +test panedwindow-19.119 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.120 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {90 24} + +test panedwindow-19.121 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{27 2} {60 2}} + +test panedwindow-19.122 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {68 5 20 20} {123 5 20 20}} + +test panedwindow-19.123 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 0 + .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 24} + +test panedwindow-19.124 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 90} + +test panedwindow-19.125 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 27} {2 60}} + +test panedwindow-19.126 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 0 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 68 20 20} {5 123 20 20}} +test panedwindow-19.127 {ComputeGeometry, one slave, reqsize set properly} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {26 24} + +test panedwindow-19.128 {ComputeGeometry, three panes, reqsize set properly} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {96 24} + +test panedwindow-19.129 {ComputeGeometry, sash coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{28 2} {64 2}} + +test panedwindow-19.130 {ComputeGeometry/ArrangePanes, slave coords} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 3 -padx 11 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}} + +test panedwindow-19.131 {ComputeGeometry, one slave, vertical} -setup { + deleteWindows +} -body { + # With just one slave, sashpad and sashwidth should not + # affect the panedwindow's geometry, since no sash should + # ever be drawn. + panedwindow .p -borderwidth 2 -sashpad 5 \ + -orient vertical -sashwidth 3 -handlesize 6 \ + -showhandle 1 + .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \ + -sticky "" + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 26} + +test panedwindow-19.132 {ComputeGeometry, three panes, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [winfo reqwidth .p] [winfo reqheight .p] +} -cleanup { + deleteWindows +} -result {24 96} + +test panedwindow-19.133 {ComputeGeometry, sash coords, vertical} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.f1 .f2 .f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky "" + } + list [.p sash coord 0] [.p sash coord 1] +} -cleanup { + deleteWindows +} -result {{2 28} {2 64}} + +test panedwindow-19.134 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup { + deleteWindows +} -body { + panedwindow .p -borderwidth 2 -sashpad 5 \ + -sashwidth 3 -handlesize 6 -showhandle 1 \ + -orient vertical + foreach w {.p.f1 .p.f2 .p.f3} { + .p add [frame $w -width 20 -height 20 -bg blue] \ + -sticky nsew -pady 11 -padx 3 + } + pack .p + update + set result {} + foreach w {.p.f1 .p.f2 .p.f3} { + lappend result [list [winfo x $w] [winfo y $w] \ + [winfo width $w] [winfo height $w]] + } + return $result +} -cleanup { + deleteWindows +} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}} + + +test panedwindow-20.1 {destroyed widgets are removed from panedwindow} -setup { + deleteWindows +} -body { panedwindow .p .p add [frame .f -width 20 -height 20 -bg blue] destroy .f - 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] \ @@ -1821,32 +4366,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] @@ -1856,10 +4407,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] @@ -1869,10 +4422,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] @@ -1882,32 +4437,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] @@ -1915,12 +4475,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] @@ -1928,12 +4488,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] @@ -1947,13 +4507,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] \ @@ -1961,10 +4522,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] @@ -1972,111 +4535,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 @@ -2084,11 +4675,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 @@ -2097,11 +4690,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 @@ -2110,11 +4705,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 @@ -2123,11 +4720,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 @@ -2136,11 +4735,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 @@ -2149,11 +4750,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 @@ -2162,11 +4765,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 @@ -2175,11 +4780,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 @@ -2188,11 +4795,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 @@ -2201,11 +4810,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 @@ -2215,52 +4826,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 @@ -2280,12 +4902,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 @@ -2305,12 +4927,12 @@ 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.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 @@ -2322,13 +4944,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 @@ -2342,13 +4964,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 @@ -2364,12 +4986,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 @@ -2385,12 +5007,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 @@ -2406,12 +5028,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 @@ -2427,12 +5049,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 @@ -2447,315 +5071,386 @@ 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 {} -} {} +} -result {} + -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] @@ -2766,11 +5461,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 + + |