summaryrefslogtreecommitdiffstats
path: root/tests/pack.test
diff options
context:
space:
mode:
authordrh <drh@sqlite.org>2001-02-12 18:06:47 (GMT)
committerdrh <drh@sqlite.org>2001-02-12 18:06:47 (GMT)
commit413e598de2e293d8046eaadcb0e4e30a9b9f49cc (patch)
treea7e13b5d6f5052a80f4cc71760b9cbdc5b952852 /tests/pack.test
parent68371803a20c54dd7674dfb0e56673f3bf1218ae (diff)
downloadtk-413e598de2e293d8046eaadcb0e4e30a9b9f49cc.zip
tk-413e598de2e293d8046eaadcb0e4e30a9b9f49cc.tar.gz
tk-413e598de2e293d8046eaadcb0e4e30a9b9f49cc.tar.bz2
Asymmetric padding in "pack" and "grid" geometry managers
Diffstat (limited to 'tests/pack.test')
-rw-r--r--tests/pack.test91
1 files changed, 77 insertions, 14 deletions
diff --git a/tests/pack.test b/tests/pack.test
index abfd0d4..a36cb58 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: pack.test,v 1.5 1999/04/21 21:53:29 rjohnson Exp $
+# RCS: @(#) $Id: pack.test,v 1.6 2001/02/12 18:06:48 drh Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -75,6 +75,12 @@ test pack-1.4 {-side option} {
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}
@@ -84,30 +90,51 @@ test pack-2.3 {x padding and filling} {
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.12 {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} {
pack forget .pack.a .pack.b .pack.c .pack.d
@@ -125,39 +152,66 @@ test pack-2.14 {x padding and filling} {
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} {
pack forget .pack.a .pack.b .pack.c .pack.d
@@ -595,9 +649,15 @@ test pack-11.11 {info option} {
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
@@ -670,18 +730,34 @@ test pack-12.15 {command options and errors} {
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} {
+ 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} {
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} {
+ 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} {
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} {
+ 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} {
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} {
+ 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} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -ipadx abc} msg] $msg
@@ -984,16 +1060,3 @@ foreach i {pack1 pack2 pack3 pack4} {
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-