Import Tk 8.6.11

This commit is contained in:
Steve Dower
2021-03-30 00:54:10 +01:00
parent 42c69189d9
commit 070b8750b0
403 changed files with 21608 additions and 16269 deletions

View File

@@ -6,21 +6,34 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
package require tcltest 2.1
package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# Platform specific procedure for updating the text widget.
if {[tk windowingsystem] == "aqua"} {
proc updateText {} {
update idletasks
}
proc delay {} {
update idletasks
after 100
update idletasks
}
} else {
proc updateText {} {
update
}
proc delay {} {
update
after 100
update
}
}
# The procedure below is used as the scrolling command for the text;
@@ -267,7 +280,7 @@ test textDisp-2.5 {LayoutDLine, word wrap} {textfonts} {
.t insert 1.0 "This isx some sample text for testing."
list [.t bbox 1.13] [.t bbox 1.19] [.t bbox 1.20] [.t bbox 1.21]
} [list [list 96 5 $fixedWidth $fixedHeight] [list 138 5 $fixedWidth $fixedHeight] [list 145 5 0 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] $fixedWidth $fixedHeight]]
test textDisp-2.6 {LayoutDLine, word wrap} {
test textDisp-2.6 {LayoutDLine, word wrap} failsOnUbuntu {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This isxxx some sample text for testing."
@@ -602,7 +615,7 @@ if {$tcl_platform(platform) == "windows"} {
test textDisp-4.6 {UpdateDisplayInfo, tiny window} {
# This test was failing on Windows because the title bar on .
# was a certain minimum size and it was interfering with the size
# requested. The "overrideredirect" gets rid of the titlebar so
# requested. The "overrideredirect" gets rid of the titlebar so
# the toplevel can shrink to the appropriate size. On Unix, setting
# the overrideredirect on "." confuses the window manager and
# causes subsequent tests to fail.
@@ -634,7 +647,7 @@ set hlth [.t cget -highlightthickness]
test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
# This test was failing on Windows because the title bar on .
# was a certain minimum size and it was interfering with the size
# requested. The "overrideredirect" gets rid of the titlebar so
# requested. The "overrideredirect" gets rid of the titlebar so
# the toplevel can shrink to the appropriate size. On Unix, setting
# the overrideredirect on "." confuses the window manager and
# causes subsequent tests to fail.
@@ -653,7 +666,7 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
updateText
set x
} {8.0 {16.0 17.0 15.0 14.0 13.0 12.0 11.0 10.0 9.0 8.0} {8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0}}
test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} {
test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} failsOnXQuarz {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview 16.0
@@ -716,7 +729,7 @@ test textDisp-4.13 {UpdateDisplayInfo, special handling for top/bottom lines} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}}
test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} {
test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} failsOnXQuarz {
.t tag remove x 1.0 end
.t yview 1.0
updateText
@@ -849,7 +862,7 @@ test textDisp-5.2 {DisplayDLine, line resizes during display} {
} [list 30 30]
.t configure -wrap char
test textDisp-6.1 {scrolling in DisplayText, scroll up} {
test textDisp-6.1 {scrolling in DisplayText, scroll up} failsOnXQuarz {
.t delete 1.0 end
.t insert 1.0 "Line 1"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
@@ -1137,7 +1150,7 @@ test textDisp-8.6 {TkTextChanged} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.7 {TkTextChanged} {
test textDisp-8.7 {TkTextChanged} failsOnXQuarz {
.t delete 1.0 end
.t insert 1.0 "Line 1 is so long that it wraps around, two times"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
@@ -1159,7 +1172,7 @@ test textDisp-8.8 {TkTextChanged} {
updateText
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
test textDisp-8.9 {TkTextChanged} {
test textDisp-8.9 {TkTextChanged} failsOnXQuarz {
.t delete 1.0 end
.t insert 1.0 "Line 1 is so long that it wraps around, two times"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
@@ -1170,7 +1183,7 @@ test textDisp-8.9 {TkTextChanged} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 8.0} {2.0 8.0}}
test textDisp-8.10 {TkTextChanged} {
test textDisp-8.10 {TkTextChanged} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
@@ -1230,7 +1243,7 @@ test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} {
update idletasks
} {}
test textDisp-9.1 {TkTextRedrawTag} {
test textDisp-9.1 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1248,7 +1261,7 @@ test textDisp-9.2 {TkTextRedrawTag} {textfonts} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{1.0 2.0 2.17} {1.0 2.0 2.17}}
test textDisp-9.3 {TkTextRedrawTag} {
test textDisp-9.3 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1259,7 +1272,7 @@ test textDisp-9.3 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
test textDisp-9.4 {TkTextRedrawTag} {
test textDisp-9.4 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1270,7 +1283,7 @@ test textDisp-9.4 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
test textDisp-9.5 {TkTextRedrawTag} {
test textDisp-9.5 {TkTextRedrawTag} {failsOnUbuntu failsOnXQuarz} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1281,7 +1294,7 @@ test textDisp-9.5 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
test textDisp-9.6 {TkTextRedrawTag} {
test textDisp-9.6 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap"
@@ -1292,7 +1305,7 @@ test textDisp-9.6 {TkTextRedrawTag} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}}
test textDisp-9.7 {TkTextRedrawTag} {
test textDisp-9.7 {TkTextRedrawTag} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
@@ -1432,7 +1445,7 @@ test textDisp-11.1 {TkTextSetYView} {
updateText
.t index @0,0
} {30.0}
test textDisp-11.2 {TkTextSetYView} {
test textDisp-11.2 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
.t yview 32.0
@@ -1446,7 +1459,7 @@ test textDisp-11.3 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
test textDisp-11.4 {TkTextSetYView} {
test textDisp-11.4 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
.t yview 31.4
@@ -1477,7 +1490,7 @@ test textDisp-11.7 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {21.0 {21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}}
test textDisp-11.8 {TkTextSetYView} {
test textDisp-11.8 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
set tk_textRedraw {}
@@ -1485,7 +1498,7 @@ test textDisp-11.8 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
test textDisp-11.9 {TkTextSetYView} {
test textDisp-11.9 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
set tk_textRedraw {}
@@ -1509,7 +1522,7 @@ test textDisp-11.11 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}}
test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} {
test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} failsOnXQuarz {
.t insert 10.0 "Long line with enough text to wrap\n"
.t yview 1.0
updateText
@@ -1850,7 +1863,7 @@ test textDisp-14.5 {TkTextXviewCmd procedure} {
test textDisp-14.6 {TkTextXviewCmd procedure} {
list [catch {.t xview moveto a} msg] $msg
} {1 {expected floating-point number but got "a"}}
test textDisp-14.7 {TkTextXviewCmd procedure} {
test textDisp-14.7 {TkTextXviewCmd procedure} failsOnUbuntu {
.t delete 1.0 end
.t insert end xxxxxxxxx\n
.t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
@@ -1902,7 +1915,7 @@ test textDisp-14.14 {TkTextXviewCmd procedure} {
.t insert end "a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9\n"
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
.t xview moveto 0
.t xview scroll 21 u
.t xview scroll 21 u
set x [.t index @0,22]
.t xview scroll -1 u
lappend x [.t index @0,22]
@@ -2050,7 +2063,7 @@ test textDisp-16.9 {TkTextYviewCmd procedure, "moveto" option} {
test textDisp-16.10 {TkTextYviewCmd procedure, "moveto" option} {
list [catch {.t yview moveto gorp} msg] $msg
} {1 {expected floating-point number but got "gorp"}}
test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} {
test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto 0.5
.t index @0,0
} {103.0}
@@ -2062,21 +2075,21 @@ test textDisp-16.13 {TkTextYviewCmd procedure, "moveto" option} {
.t yview moveto 1.1
.t index @0,0
} {191.0}
test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} {
test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto .75
.t index @0,0
} {151.60}
test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} {
test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto .752
.t index @0,0
} {151.60}
test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} {textfonts} {
test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} textfonts {
set count [expr {5 * $bigHeight + 150 * $fixedHeight}]
set extra [expr {0.04 * double($fixedDiff * 150) / double($count)}]
.t yview moveto [expr {.753 - $extra}]
.t index @0,0
} {151.60}
test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} {
test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
.t yview moveto .755
.t index @0,0
} {151.80}
@@ -2240,7 +2253,7 @@ test textDisp-16.38 {TkTextYviewCmd procedure} {
test textDisp-16.39 {TkTextYviewCmd procedure} {
list [catch {.t yview scroll 1.3i pixels} msg] $msg
} {0 {}}
test textDisp-16.40 {text count -xpixels} {
test textDisp-16.40 {text count -xpixels} failsOnUbuntu {
set res {}
lappend res [.t count -xpixels 1.0 1.5] \
[.t count -xpixels 1.5 1.0] \
@@ -2359,7 +2372,7 @@ test textDisp-17.8 {TkTextScanCmd procedure} {textfonts} {
.t xview moveto 0
.t scan mark 0 60
.t scan dragto 30 100
.t scan dragto 25 95
.t scan dragto 25 95
.t index @0,0
} {4.7}
test textDisp-17.9 {TkTextScanCmd procedure} {textfonts} {
@@ -2554,7 +2567,7 @@ test textDisp-19.7 {GetYView procedure} {
updateText
set x $scrollInfo
} {0.125 0.75}
test textDisp-19.8 {GetYView procedure} {
test textDisp-19.8 {GetYView procedure} failsOnUbuntu {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
@@ -2851,7 +2864,7 @@ test textDisp-19.16 {count -ypixels} {
[.t count -ypixels 16.0 "16.0 displaylineend +1c"] \
[.t count -ypixels "16.0 +1 displaylines" "16.0 +4 displaylines +3c"]
} [list [expr {260 + 20 * $fixedDiff}] [expr {260 + 20 * $fixedDiff}] $fixedHeight [expr {2*$fixedHeight}] $fixedHeight [expr {3*$fixedHeight}]]
test textDisp-19.17 {count -ypixels with indices in elided lines} {
test textDisp-19.17 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -2878,7 +2891,7 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} {
.t yview 35.0
lappend res [.t count -ypixels 5.0 25.0]
} [list [expr {4 * $fixedHeight}] [expr {3 * $fixedHeight}] 0 0 0 0 0 0 [expr {5 * $fixedHeight}] [expr {- 5 * $fixedHeight}] [expr {2 * $fixedHeight}] [expr {3 * $fixedHeight}] [expr {5 * $fixedHeight}]]
test textDisp-19.18 {count -ypixels with indices in elided lines} {
test textDisp-19.18 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -2916,28 +2929,28 @@ for {set i 2} {$i <= 200} {incr i} {
.t configure -wrap word
.t delete 50.0 51.0
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
test textDisp-20.1 {FindDLine} {
test textDisp-20.1 {FindDLine} failsOnUbuntu {
.t yview 48.0
list [.t dlineinfo 46.0] [.t dlineinfo 47.0] [.t dlineinfo 49.0] \
[.t dlineinfo 58.0]
} [list {} {} [list 3 [expr {$fixedDiff + 16}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
test textDisp-20.2 {FindDLine} {
test textDisp-20.2 {FindDLine} failsOnUbuntu {
.t yview 100.0
.t yview -pickplace 53.0
list [.t dlineinfo 50.0] [.t dlineinfo 50.14] [.t dlineinfo 50.21]
} [list [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {12 + $fixedDiff/2}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]]
test textDisp-20.3 {FindDLine} {
test textDisp-20.3 {FindDLine} failsOnUbuntu {
.t yview 100.0
.t yview 49.0
list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 57.0]
} [list [list 3 [expr {$fixedDiff + 16}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {2*$fixedDiff + 29}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
test textDisp-20.4 {FindDLine} {
test textDisp-20.4 {FindDLine} failsOnUbuntu {
.t yview 100.0
.t yview 42.0
list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 50.40]
} [list [list 3 [expr {8*$fixedDiff + 107}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
.t config -wrap none
test textDisp-20.5 {FindDLine} {
test textDisp-20.5 {FindDLine} failsOnUbuntu {
.t yview 100.0
.t yview 48.0
list [.t dlineinfo 50.0] [.t dlineinfo 50.20] [.t dlineinfo 50.40]
@@ -2970,7 +2983,7 @@ test textDisp-21.4 {count -displaylines regression} {
Use the Up (cursor) key to scroll up one line at a time. At the second press, the cursor either gets locked or jumps several lines.
Connect with Tkcon. The command
.u count -displaylines \
.u count -displaylines \
3.10 2.173
should give answer -1; it gives me 5.
@@ -3395,7 +3408,7 @@ test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} {textfonts} {
.t tag add x 1.0 end
list [.t bbox 1.0] [.t bbox 1.10]
} [list [list 45 3 7 $fixedHeight] [list 94 3 7 $fixedHeight]]
test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts} -setup {
test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts failsOnXQuarz} -setup {
text .tt -tabs {40 right} -wrap none -font $fixedFont
pack .tt
} -body {
@@ -3874,7 +3887,7 @@ test textDisp-29.2.5 {miscellaneous: can show last character} {
set iWidth [lindex [.t2.t bbox end-2c] 2]
.t2.t xview scroll 2 units
set iWidth2 [lindex [.t2.t bbox end-2c] 2]
if {($iWidth == $iWidth2) && $iWidth >= 2} {
set result "correct"
} else {
@@ -3917,7 +3930,7 @@ catch {destroy .t2}
.t configure -height 1
updateText
test textDisp-31.1 {line embedded window height update} {
test textDisp-31.1 {line embedded window height update} failsOnUbuntu {
set res {}
.t delete 1.0 end
.t insert end "abcd\nefgh\nijkl\nmnop\nqrst\nuvwx\nyx"
@@ -3930,7 +3943,7 @@ test textDisp-31.1 {line embedded window height update} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]]
test textDisp-31.2 {line update index shifting} {
test textDisp-31.2 {line update index shifting} failsOnUbuntu {
set res {}
.t.f configure -height 100
updateText
@@ -3947,7 +3960,7 @@ test textDisp-31.2 {line update index shifting} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
test textDisp-31.3 {line update index shifting} {
test textDisp-31.3 {line update index shifting} failsOnUbuntu {
# Should do exactly the same as the above, as long
# as we are correctly tagging the correct lines for
# recalculation. The 'update' and 'delay' must be
@@ -3961,12 +3974,12 @@ test textDisp-31.3 {line update index shifting} {
.t insert 1.0 "abc\n"
.t insert 1.0 "abc\n"
lappend res [.t count -ypixels 1.0 end]
update ; after 1000 ; update
delay
lappend res [.t count -ypixels 1.0 end]
.t.f configure -height 100
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
update ; after 1000 ; update
delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
@@ -3984,7 +3997,7 @@ test textDisp-31.4 {line embedded image height update} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]]
test textDisp-31.5 {line update index shifting} {
test textDisp-31.5 {line update index shifting} failsOnUbuntu {
set res {}
textest configure -height 100
updateText
@@ -4001,7 +4014,7 @@ test textDisp-31.5 {line update index shifting} {
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
test textDisp-31.6 {line update index shifting} {
test textDisp-31.6 {line update index shifting} failsOnUbuntu {
# Should do exactly the same as the above, as long
# as we are correctly tagging the correct lines for
# recalculation. The 'update' and 'delay' must be
@@ -4014,12 +4027,12 @@ test textDisp-31.6 {line update index shifting} {
.t insert 1.0 "abc\n"
.t insert 1.0 "abc\n"
lappend res [.t count -ypixels 1.0 end]
update ; after 1000 ; update
delay
lappend res [.t count -ypixels 1.0 end]
textest configure -height 100
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
update ; after 1000 ; update
delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
@@ -4036,11 +4049,11 @@ test textDisp-31.7 {line update index shifting, elided} {
.t tag configure elide -elide 1
.t tag add elide 1.3 2.1
lappend res [.t count -ypixels 1.0 end]
update ; after 1000 ; update
delay
lappend res [.t count -ypixels 1.0 end]
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
update ; after 1000 ; update
delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {$fixedHeight * 1}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 2}] [expr {$fixedHeight * 1}] [expr {$fixedHeight * 1}]]
@@ -4175,6 +4188,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup {
test textDisp-33.0 {one line longer than fits in the widget} {
pack [text .tt -wrap char]
updateText
.tt insert 1.0 [string repeat "more wrap + " 300]
updateText
.tt see 1.0
@@ -4183,6 +4197,7 @@ test textDisp-33.0 {one line longer than fits in the widget} {
test textDisp-33.1 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
updateText
.tt insert 1.0 [string repeat "more wrap + " 300]
updateText
.tt yview "1.0 +1 displaylines"
@@ -4196,12 +4211,14 @@ test textDisp-33.2 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
.tt debug 1
updateText
set tk_textHeightCalc ""
set timer [after 200 lappend tk_textHeightCalc "Timed out"]
.tt insert 1.0 [string repeat "more wrap + " 1]
after 100 ; update idletasks
# Nothing should have been recalculated.
vwait tk_textHeightCalc
after cancel $timer
set tk_textHeightCalc
} {}
} {1.0}
test textDisp-33.3 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]