summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2016-10-26 08:32:02 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2016-10-26 08:32:02 (GMT)
commitd04dfe669f965ba4b6fd0190c91e2ff8ee7b2445 (patch)
tree90944727a276582aa265d164f26823e198cad1f6
parent1d71e9e9f99db725fc76a9886e56f69e65ecd513 (diff)
downloadtk-tip_454.zip
tk-tip_454.tar.gz
tk-tip_454.tar.bz2
frame resize tests exercice all paths of pack and grid, removed tests for different master widget types, as it is a pack/grid issuetip_454
-rwxr-xr-xtests/grid.test34
-rwxr-xr-xtests/pack.test34
2 files changed, 51 insertions, 17 deletions
diff --git a/tests/grid.test b/tests/grid.test
index c00da96..0365b24 100755
--- a/tests/grid.test
+++ b/tests/grid.test
@@ -1998,7 +1998,7 @@ test grid-22.5 {remove} {
grid info .c
} {-in . -column 0 -row 0 -columnspan 2 -rowspan 2 -ipadx 0 -ipady 0 -padx {3 5} -pady {4 7} -sticky ns}
grid_reset 22.5
-test grid-23.1 {frame returns to 1x1 when children ungridded (tip 454)} {
+test grid-23.1 {frame returns to 1x1 when children destroyed (tip 454)} {
grid [frame .f]
grid [frame .f.f]
grid [entry .f.f.e]
@@ -2009,28 +2009,42 @@ test grid-23.1 {frame returns to 1x1 when children ungridded (tip 454)} {
lappend res [winfo reqwidth .f.f] [winfo reqheight .f.f]
} {1 1 1 1}
grid_reset 23.1
-test grid-23.2 {ttk::frame returns to 1x1 when children ungridded (tip 454)} {
+test grid-23.2 {frame keeps size when children destroyed with propagate off (tip 454)} {
grid [frame .f]
- grid [ttk::frame .f.f]
+ grid [frame .f.f]
+ grid [entry .f.f.e]
+ update
+ set w [winfo reqwidth .f.f]
+ set h [winfo reqheight .f.f]
+ grid propagate .f.f 0
+ destroy .f.f.e
+ list [expr { $w - [winfo reqwidth .f.f]}]\
+ [expr {$h - [winfo reqheight .f.f]}]
+} {0 0}
+grid_reset 23.2
+test grid-23.3 {frame returns to 1x1 when children ungridded (tip 454)} {
+ grid [frame .f]
+ grid [frame .f.f]
grid [entry .f.f.e]
update
set res [list [expr {[winfo reqwidth .f.f] > 1}]\
[expr {[winfo reqheight .f.f] > 1}]]
- destroy .f.f.e
+ grid forget .f.f.e
lappend res [winfo reqwidth .f.f] [winfo reqheight .f.f]
} {1 1 1 1}
-grid_reset 23.2
-test grid-23.2 {ttk::labelframe returns to 1x1 when children ungridded (tip 454)} {
+grid_reset 23.3
+test grid-23.4 {frame returns to 1x1 when children moved (tip 454)} {
grid [frame .f]
- grid [ttk::labelframe .f.f]
- grid [entry .f.f.e]
+ grid [frame .f.f]
+ grid [entry .e] -in .f.f
+ grid [frame .f2]
update
set res [list [expr {[winfo reqwidth .f.f] > 1}]\
[expr {[winfo reqheight .f.f] > 1}]]
- destroy .f.f.e
+ grid configure .e -in .f2
lappend res [winfo reqwidth .f.f] [winfo reqheight .f.f]
} {1 1 1 1}
-grid_reset 23.2
+grid_reset 23.4
# cleanup
cleanupTests
diff --git a/tests/pack.test b/tests/pack.test
index 72f53d4..99f1028 100755
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1625,7 +1625,7 @@ test pack-19.2 {test support for minreqsize} -setup {
destroy .pack.l .pack.lf
} -result {162x127+0+0 172x112+0+0}
-test pack-20.1 {frame returns to 1x1 when children unpacked (tip 454)} -setup {
+test pack-20.1 {frame returns to 1x1 when children destroyed (tip 454)} -setup {
catch {eval pack forget [pack slaves .pack]}
destroy .pack.f
} -body {
@@ -1638,7 +1638,22 @@ test pack-20.1 {frame returns to 1x1 when children unpacked (tip 454)} -setup {
lappend res [winfo reqwidth .pack.f] [winfo reqheight .pack.f]
} -result {1 1 1 1}
-test pack-20.2 {ttk::frame returns to 1x1 when children unpacked (tip 454)} -setup {
+test pack-20.2 {frame keeps size when children destroyed and no propagation (tip 454)} -setup {
+ catch {eval pack forget [pack slaves .pack]}
+ destroy .pack.f
+} -body {
+ pack [frame .pack.f]
+ pack [entry .pack.f.e]
+ update
+ set w [winfo reqwidth .pack.f]
+ set h [winfo reqheight .pack.f]
+ pack propagate .pack.f 0
+ destroy .pack.f.e
+ list [expr {$w - [winfo reqwidth .pack.f]}]\
+ [expr {$h - [winfo reqheight .pack.f]}]
+} -result {0 0}
+
+test pack-20.3 {ttk::frame returns to 1x1 when children unpacked (tip 454)} -setup {
catch {eval pack forget [pack slaves .pack]}
destroy .pack.f
} -body {
@@ -1647,19 +1662,24 @@ test pack-20.2 {ttk::frame returns to 1x1 when children unpacked (tip 454)} -set
update
set res [list [expr {[winfo reqwidth .pack.f] > 1}]\
[expr {[winfo reqheight .pack.f] > 1}]]
- destroy .pack.f.e
+ pack forget .pack.f.e
lappend res [winfo reqwidth .pack.f] [winfo reqheight .pack.f]
} -result {1 1 1 1}
-test pack-20.3 {ttk::labelframe returns to 1x1 when children unpacked (tip 454)} -setup {
+
+test pack-20.4 {ttk::frame returns to 1x1 when children moved (tip 454)} -setup {
catch {eval pack forget [pack slaves .pack]}
destroy .pack.f
+ destroy .pack.f2
+ destroy .pack.e
} -body {
- pack [ttk::labelframe .pack.f]
- pack [entry .pack.f.e]
+ pack [ttk::frame .pack.f]
+ pack [ttk::frame .pack.f2]
+ entry .pack.e
+ pack .pack.e -in .pack.f
update
set res [list [expr {[winfo reqwidth .pack.f] > 1}]\
[expr {[winfo reqheight .pack.f] > 1}]]
- destroy .pack.f.e
+ pack configure .pack.e -in .pack.f2
lappend res [winfo reqwidth .pack.f] [winfo reqheight .pack.f]
} -result {1 1 1 1}