diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-01-07 13:08:00 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-01-07 13:08:00 (GMT) |
commit | b69c5f3b5f46c17361a5cbf3676cad5ba0ac03be (patch) | |
tree | efb52b9f04bd643c9a6c0b30c519e22426c2dc59 /tests/textDisp.test | |
parent | f15ea04198e91649339310b7acf546b91e768e00 (diff) | |
parent | 5faa9a11695c74d40ca830ee4dcd68cfc9011e89 (diff) | |
download | tk-b69c5f3b5f46c17361a5cbf3676cad5ba0ac03be.zip tk-b69c5f3b5f46c17361a5cbf3676cad5ba0ac03be.tar.gz tk-b69c5f3b5f46c17361a5cbf3676cad5ba0ac03be.tar.bz2 |
rebase "tip-438" branch to latest trunk.tip_438
Diffstat (limited to 'tests/textDisp.test')
-rw-r--r-- | tests/textDisp.test | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test index ac3aee0..caba769 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4197,29 +4197,34 @@ test textDisp-33.5 {bold or italic fonts} win { } {italic font measurement ok} destroy .tt -test textDisp-34.1 {Text widgets multi-scrolling problem: Bug 2677890} -setup { - pack [text .t1 -width 10 -yscrollcommand {.sy set}] \ - [ttk::scrollbar .sy -orient vertical -command {.t1 yview}] \ - -side left -fill both - bindtags .sy {}; # No clicky! +test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { + pack [text .t1] -expand 1 -fill both set txt "" - for {set i 0} {$i < 99} {incr i} { - lappend txt "$i" [list pc $i] "\n" "" + for {set i 1} {$i < 100} {incr i} { + append txt "Line $i\n" } set result {} } -body { - .t1 insert end {*}$txt - update - lappend result [.sy get] - .t1 replace 6.0 6.0+1c "*" - lappend result [.sy get] - after 0 {lappend result [.sy get]} - after 1000 {lappend result [.sy get]} - vwait result;vwait result - return $result + .t1 insert end $txt + .t1 debug 1 + set ge [winfo geometry .] + scan $ge "%dx%d+%d+%d" width height left top + update + .t1 sync + set negative 0 + bind .t1 <<WidgetViewSync>> { if {%d < 0} {set negative 1} } + # Without the fix for bug 2677890, changing the width of the toplevel + # will launch recomputation of the line heights, but will produce negative + # number of still remaining outdated lines, which is obviously wrong. + # Thus we use this way to check for regression regarding bug 2677890, + # i.e. to check that the fix for this bug really is still in. + wm geometry . "[expr {$width * 2}]x$height+$left+$top" + update + .t1 sync + set negative } -cleanup { - destroy .t1 .sy -} -result {{0.0 0.24} {0.0 0.24} {0.0 0.24} {0.0 0.24}} + destroy .t1 +} -result {0} test textDisp-35.1 {Init value of charHeight - Dancing scrollbar bug 1499165} -setup { pack [text .t1] -fill both -expand y -side left |