summaryrefslogtreecommitdiffstats
path: root/tests/textDisp.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-10-02 21:00:29 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-10-02 21:00:29 (GMT)
commit252123a50de3f9772249d8f439f60ee0e2a32010 (patch)
treef4bcc32af8e81ce04042644a6d27b979f6f62cdd /tests/textDisp.test
parent07be08d69cbabadf2a1b43d4c38995cc739e9abe (diff)
parent9549fdb1087bd31f052077f48fcb1cd88d514774 (diff)
downloadtk-252123a50de3f9772249d8f439f60ee0e2a32010.zip
tk-252123a50de3f9772249d8f439f60ee0e2a32010.tar.gz
tk-252123a50de3f9772249d8f439f60ee0e2a32010.tar.bz2
Merge core-8-6-branch that just received changes from unstable_tests branch. This commit stabilizes a lot of tests that could sporadically fail, mainly on macOS. No test results were changed, except for entry-5.7 and spinbox-5.7 which expected results were found to be wrong (these tests passes due to a race condition that is now fixed).
Diffstat (limited to 'tests/textDisp.test')
-rw-r--r--tests/textDisp.test867
1 files changed, 430 insertions, 437 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test
index a8926bb..8fd2edf 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -11,19 +11,12 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
-# Procedures for updating the text widget. These are isolated here
-# to allow for variations between platforms, but are currently the
-# same for all platforms (see ticket [bfea11a916]). The delay
-# procedure needs to wait long enough for the asynchronous updates
+# The delay procedure needs to wait long enough for the asynchronous updates
# performed by the text widget to run.
-
-proc updateText {} {
- update
-}
proc delay {} {
- update
- after 100
- update
+ update
+ after 100
+ update
}
# The procedure below is used as the scrolling command for the text;
@@ -155,7 +148,7 @@ wm withdraw .
wm minsize . 1 1
wm positionfrom . user
wm deiconify .
-updateText
+update
# Some window managers (like olwm under SunOS 4.1.3) misbehave in a way
# that tends to march windows off the top and left of the screen. If
@@ -236,7 +229,7 @@ test textDisp-0.3 {double tag elide transition} {
.txt tag configure SYSTEM -elide 0
.txt tag configure TRAFFIC -elide 1
.txt insert end "\n" {TRAFFIC SYSTEM}
- updateText
+ update
destroy .txt
} {}
@@ -249,7 +242,7 @@ test textDisp-0.4 {double tag elide transition} {
.txt tag configure TRAFFIC -elide 1
.txt insert end "\n" {SYSTEM TRAFFIC}
# Crash was here.
- updateText
+ update
destroy .txt
} {}
@@ -263,7 +256,7 @@ test textDisp-0.5 {double tag elide transition} {
.txt insert end "\n" {SYSTEM TRAFFIC}
.txt insert end "\n" WELCOME
# Crash was here.
- updateText
+ update
destroy .txt
} {}
@@ -294,7 +287,7 @@ test textDisp-1.2 {GetStyle procedure, wrapmode} {
.t tag configure x -wrap word
.t tag configure y -wrap none
.t tag raise y
- updateText
+ update
set result [list [.t bbox 2.20]]
.t tag add x 2.0 2.1
lappend result [.t bbox 2.20]
@@ -366,7 +359,7 @@ test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} -setup {
scan [wm geom .] %dx%d width height
} -body {
wm geom . [expr {$width+1}]x$height
- updateText
+ update
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "This isxx some sample text for testing."
@@ -374,7 +367,7 @@ test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} -setup {
list [.t bbox 1.19] [.t bbox 1.20]
} -cleanup {
wm geom . {}
- updateText
+ update
} -result [list [list [xchar 19] [yline 1] [expr {$fixedWidth+1}] $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
test textDisp-2.9 {LayoutDLine, marks and tags} {
@@ -676,12 +669,12 @@ test textDisp-3.1 {different character sizes} {
test textDisp-4.1 {UpdateDisplayInfo, basic} {
.t delete 1.0 end
.t insert end "Line 1\nLine 2\nLine 3\n"
- updateText
+ update
.t delete 2.0 2.end
- updateText
+ update
set res $tk_textRelayout
.t insert 2.0 "New Line 2"
- updateText
+ update
lappend res [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk_textRelayout
} [list 2.0 \
[list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \
@@ -691,13 +684,13 @@ test textDisp-4.1 {UpdateDisplayInfo, basic} {
test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
.t mark set x 2.21
.t delete 2.2
- updateText
+ update
set res $tk_textRelayout
.t insert 2.0 X
- updateText
+ update
lappend res [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout
} [list 2.0 2.20 \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
@@ -707,10 +700,10 @@ test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {
test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} {
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
.t mark set x 2.21
.t delete 2.2
- updateText
+ update
list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout
} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
[list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
@@ -721,7 +714,7 @@ test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout
} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
{} \
@@ -732,11 +725,11 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} {
wm overrideredirect . 1
}
wm geom . 103x$height
- updateText
+ update
.t configure -wrap none
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout
} [list [list [xchar 0] [yline 2] 1 $fixedHeight] \
{} \
@@ -759,21 +752,21 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} {
frame .f2 -width 20 -height 100
pack .f2 -before .f
wm geom . 103x103
- updateText
+ update
.t configure -wrap none -borderwidth 2
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout]
wm overrideredirect . 0
- updateText
+ update
set expected [list [list [xchar 0] [yline 1] 1 1] {} 1.0]
lequal $x $expected
} {1}
catch {destroy .f2}
.t configure -borderwidth 0 -wrap char
wm geom . {}
-updateText
+update
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
@@ -788,28 +781,28 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
.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 1.0
- updateText
+ update
.t yview 16.0
- updateText
+ update
set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw]
wm overrideredirect . 0
- updateText
+ update
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} {
.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
- updateText
+ update
.t delete 5.0 14.0
- updateText
+ update
set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw]
} {1.0 {5.0 4.0 3.0 2.0 1.0} {1.0 2.0 3.0 4.0 5.0 eof}}
test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {
.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
- updateText
+ update
.t delete 15.0 end
list [.t bbox 7.0] [.t bbox 12.0]
} [list [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
@@ -818,18 +811,18 @@ test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview end
- updateText
+ update
.t delete 13.0 end
- updateText
+ update
list [.t index @0,0] $tk_textRelayout $tk_textRedraw
} {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}}
test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around, not once but really quite a few times.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview end
- updateText
+ update
.t delete 14.0 end
- updateText
+ update
list [.t index @0,0] $tk_textRelayout $tk_textRedraw
} {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}}
test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
@@ -838,11 +831,11 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
button .b -text "Test" -bd 2 -highlightthickness 2
.t window create 3.end -window .b
.t yview moveto 1
- updateText
+ update
.t yview moveto 0
- updateText
+ update
.t yview moveto 1
- updateText
+ update
winfo ismapped .b
} 0
.t configure -wrap word
@@ -855,33 +848,33 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
test textDisp-4.13 {UpdateDisplayInfo, special handling for top/bottom lines} {
.t tag add x 1.0 end
.t yview 1.0
- updateText
+ update
.t yview scroll 3 units
- updateText
+ update
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} {
.t tag remove x 1.0 end
.t yview 1.0
- updateText
+ update
.t yview scroll 3 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{11.0 12.0 13.0} {11.0 12.0 13.0}}
test textDisp-4.15 {UpdateDisplayInfo, special handling for top/bottom lines} {
.t tag add x 1.0 end
.t yview 4.0
- updateText
+ update
.t yview scroll -2 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0 4.0 11.0}}
test textDisp-4.16 {UpdateDisplayInfo, special handling for top/bottom lines} {
.t tag remove x 1.0 end
.t yview 4.0
- updateText
+ update
.t yview scroll -2 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0}}
test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {
@@ -889,9 +882,9 @@ test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
- updateText
+ update
.t xview scroll 3 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.0] [.t bbox 2.5] \
[.t bbox 2.23]
} [list {} {1.0 2.0 3.0 4.0} \
@@ -903,9 +896,9 @@ test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} {
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
- updateText
+ update
.t xview scroll 100 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.25]
} [list {} {1.0 2.0 3.0 4.0} \
[list [xcharr 19] [yline 2] $fixedWidth $fixedHeight]]
@@ -914,10 +907,10 @@ test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
- updateText
+ update
.t xview moveto 0
.t xview scroll -10 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.5]
} [list {} {1.0 2.0 3.0 4.0} \
[list [xchar 5] [yline 2] $fixedWidth $fixedHeight]]
@@ -928,9 +921,9 @@ test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {
.t insert end "\nLine 3\nLine 4"
.t xview moveto 0.0
.t xview scroll 100 units
- updateText
+ update
.t delete 2.30 2.44
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.25]
} [list 2.0 {1.0 2.0 3.0 4.0} \
[list [xcharr 5] [yline 2] $fixedWidth $fixedHeight]]
@@ -940,9 +933,9 @@ test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
.t xview moveto .9
- updateText
+ update
.t xview moveto .6
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {}}
test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {
@@ -951,7 +944,7 @@ test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
.t xview scroll 25 units
- updateText
+ update
.t configure -wrap word
list [.t bbox 2.0] [.t bbox 2.16]
} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
@@ -962,7 +955,7 @@ test textDisp-4.23 {UpdateDisplayInfo, no horizontal scrolling except for -wrap
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
.t xview scroll 25 units
- updateText
+ update
.t configure -wrap char
list [.t bbox 2.0] [.t bbox 2.16]
} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
@@ -982,7 +975,7 @@ test textDisp-5.1 {DisplayDLine, handling of spacing} {
.t window create 1.7 -window .t.f2 -align center
.t window create 2.1 -window .t.f3 -align bottom
.t window create 2.10 -window .t.f4 -align baseline
- updateText
+ update
list [winfo geometry .t.f1] [winfo geometry .t.f2] \
[winfo geometry .t.f3] [winfo geometry .t.f4]
} [list 10x4+[xchar 3]+[expr {[yline 1]+8}] \
@@ -999,7 +992,7 @@ test textDisp-5.2 {DisplayDLine, line resizes during display} {
frame .t.f -width 20 -height 20 -bd 2 -relief raised
bind .t.f <Configure> {.t.f configure -width 30 -height 30}
.t window create insert -window .t.f
- updateText
+ update
list [winfo width .t.f] [winfo height .t.f]
} [list 30 30]
@@ -1010,9 +1003,9 @@ test textDisp-6.1 {scrolling in DisplayText, scroll up} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.0 3.0
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 10.0} {2.0 10.0}}
test textDisp-6.2 {scrolling in DisplayText, scroll down} {
@@ -1021,9 +1014,9 @@ test textDisp-6.2 {scrolling in DisplayText, scroll down} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.0 "New Line 2\n"
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0}}
test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} {
@@ -1033,10 +1026,10 @@ test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.end "is so long that it wraps"
.t insert 4.end "is so long that it wraps"
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 4.0 4.20} {2.0 2.20 4.0 4.20}}
test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} {
@@ -1046,10 +1039,10 @@ test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.end "is so long that it wraps around, not once but three times"
.t insert 4.end "is so long that it wraps"
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 2.40 2.60 4.0 4.20} {2.0 2.20 2.40 2.60 4.0 4.20 6.0}}
test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {aquaKnownBug} {
@@ -1062,9 +1055,9 @@ test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {aquaKnownB
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.6 1.end
- updateText
+ update
destroy .f2
list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}}
@@ -1081,31 +1074,31 @@ test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {aquaKn
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.6 1.end
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0}}
.t configure -bd 0
test textDisp-6.7 {DisplayText, vertical scrollbar updates} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-6.8 {DisplayText, vertical scrollbar updates} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
- updateText
+ update
set scrollInfo "unchanged"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t count -update -ypixels 1.0 end ; update
set scrollInfo
} [list 0.0 [expr {10.0/13}]]
@@ -1113,12 +1106,12 @@ test textDisp-6.8 {DisplayText, vertical scrollbar updates} {
test textDisp-6.9 {DisplayText, horizontal scrollbar updates} {
.t configure -wrap none
.t delete 1.0 end
- updateText
+ update
set scrollInfo unchanged
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua} {
@@ -1137,9 +1130,9 @@ test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua}
.t insert end "\nLine 8\n"
.t window create end -create {
button %W.button_three -text "Button 3"}
- updateText
+ update
.t delete 2.0 3.0
- updateText
+ update
list $tk_textEmbWinDisplay
} {{4.0 6.0}}
@@ -1154,27 +1147,27 @@ test textDisp-7.1 {TkTextRedrawRegion} {aquaKnownBug} {
# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.2 -relwidth 0.6 -rely 0.22 -relheight 0.55
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {1.40 2.0 3.0 4.0 5.0 6.0}}
test textDisp-7.2 {TkTextRedrawRegion} {aquaKnownBug} {
# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0 -relwidth 0.5 -rely 0 -relheight 0.5
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {1.0 1.20 1.40 2.0 3.0}}
test textDisp-7.3 {TkTextRedrawRegion} {aquaKnownBug} {
# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.5 -relwidth 0.5 -rely 0.5 -relheight 0.5
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {4.0 5.0 6.0 7.0 8.0}}
test textDisp-7.4 {TkTextRedrawRegion} {aquaKnownBug} {
@@ -1182,9 +1175,9 @@ test textDisp-7.4 {TkTextRedrawRegion} {aquaKnownBug} {
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 0 -relheight 0.2 \
-bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 1.0 1.20}}
test textDisp-7.5 {TkTextRedrawRegion} {aquaKnownBug} {
@@ -1192,9 +1185,9 @@ test textDisp-7.5 {TkTextRedrawRegion} {aquaKnownBug} {
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 1.0 -relheight 0.2 \
-anchor s -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 7.0 8.0}}
test textDisp-7.6 {TkTextRedrawRegion} {aquaKnownBug} {
@@ -1202,9 +1195,9 @@ test textDisp-7.6 {TkTextRedrawRegion} {aquaKnownBug} {
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \
-anchor w -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 3.0 4.0 5.0}}
test textDisp-7.7 {TkTextRedrawRegion} {aquaKnownBug} {
@@ -1212,9 +1205,9 @@ test textDisp-7.7 {TkTextRedrawRegion} {aquaKnownBug} {
frame .f2 -bg #ff0000
place .f2 -in .t -relx 1.0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \
-anchor e -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 3.0 4.0 5.0}}
test textDisp-7.8 {TkTextRedrawRegion} {aquaKnownBug} {
@@ -1224,9 +1217,9 @@ test textDisp-7.8 {TkTextRedrawRegion} {aquaKnownBug} {
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.0 -relwidth 0.4 -rely 0.35 -relheight 0.4 \
-anchor nw -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 4.0 5.0 6.0 7.0 eof}}
.t configure -bd 0
@@ -1238,9 +1231,9 @@ test textDisp-8.1 {TkTextChanged: redisplay whole lines} {
foreach i {3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.36 2.38
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.32]
} [list {2.0 2.18 2.38} {2.0 2.18 2.38} [list [xchar 14] [yline 3] $fixedWidth $fixedHeight]]
.t configure -wrap char
@@ -1250,9 +1243,9 @@ test textDisp-8.2 {TkTextChanged, redisplay whole lines} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 1.2 xx
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.3 {TkTextChanged} {
@@ -1261,9 +1254,9 @@ test textDisp-8.3 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.0 xx
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
test textDisp-8.4 {TkTextChanged} {
@@ -1272,9 +1265,9 @@ test textDisp-8.4 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.5
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.5 {TkTextChanged} {
@@ -1283,9 +1276,9 @@ test textDisp-8.5 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.40 1.44
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.6 {TkTextChanged} {
@@ -1294,9 +1287,9 @@ test textDisp-8.6 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.41 1.44
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.7 {TkTextChanged} {
@@ -1305,9 +1298,9 @@ test textDisp-8.7 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.2 1.end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 9.0 10.0}}
test textDisp-8.8 {TkTextChanged} {
@@ -1316,9 +1309,9 @@ test textDisp-8.8 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
test textDisp-8.9 {TkTextChanged} {
@@ -1327,9 +1320,9 @@ test textDisp-8.9 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.0 3.0
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 8.0} {2.0 8.0}}
test textDisp-8.10 {TkTextChanged} {
@@ -1337,23 +1330,23 @@ test textDisp-8.10 {TkTextChanged} {
.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"
.t tag add big 2.19
- updateText
+ update
.t delete 2.19
- updateText
+ update
set tk_textRedraw
} {2.0 2.20 eof}
test textDisp-8.11 {TkTextChanged, scrollbar notification when changes are off-screen} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n"
.t configure -yscrollcommand scroll
- updateText
+ update
set scrollInfo ""
.t insert end "a\nb\nc\n"
# We need to wait for our asychronous callbacks to update the
# scrollbar
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ update
.t configure -yscrollcommand ""
set scrollInfo
} {0.0 0.625}
@@ -1366,27 +1359,27 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an
.t tag add hidden 5.0 8.0
.t tag configure hidden -elide true
.t mark set insert 9.0
- updateText
+ update
.t mark set insert 8.0 ; # up one line
- updateText
+ update
set res [list $tk_textRedraw]
.t mark set insert 12.2 ; # in the visible text
- updateText
+ update
lappend res $tk_textRedraw
.t mark set insert 6.5 ; # in the hidden text
- updateText
+ update
lappend res $tk_textRedraw
.t mark set insert 3.5 ; # in the visible text again
- updateText
+ update
lappend res $tk_textRedraw
.t mark set insert 3.8 ; # within the same line
- updateText
+ update
lappend res $tk_textRedraw
} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {3.0 4.0}}
test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} {
.t delete 1.0 end
.t insert 1.0 \nLine2\nLine3\n
- updateText
+ update
.t insert 3.0 ""
.t delete 1.0 2.0
update idletasks
@@ -1396,9 +1389,9 @@ test textDisp-9.1 {TkTextRedrawTag} -body {
.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"
- updateText
+ update
.t tag add big 2.2 2.4
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
# glob matching is to have some tolerance on actually used font size
# while still testing what we want to test
@@ -1407,9 +1400,9 @@ test textDisp-9.2 {TkTextRedrawTag} -body {
.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"
- updateText
+ update
.t tag add big 1.2 2.4
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
# glob matching is to have some tolerance on actually used font size
# while still testing what we want to test
@@ -1418,22 +1411,22 @@ test textDisp-9.3 {TkTextRedrawTag} {
.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"
- updateText
+ update
.t tag add big 2.2 2.4
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
test textDisp-9.4 {TkTextRedrawTag} {
.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"
- updateText
+ update
.t tag add big 2.2 2.20
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
test textDisp-9.5 {TkTextRedrawTag} -setup {
@@ -1441,25 +1434,25 @@ test textDisp-9.5 {TkTextRedrawTag} -setup {
} -body {
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
- updateText
+ update
.t tag add big 2.2 2.end
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} -cleanup {
.t configure -height [expr {[.t cget -height]-10}]
- updateText
+ update
} -result {{2.0 2.20} {2.0 2.20 eof}}
test textDisp-9.6 {TkTextRedrawTag} {
.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"
- updateText
+ update
.t tag add big 2.2 3.5
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
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} {
@@ -1467,9 +1460,9 @@ test textDisp-9.7 {TkTextRedrawTag} {
.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"
.t tag add big 2.19
- updateText
+ update
.t tag remove big 2.19
- updateText
+ update
set tk_textRedraw
} {2.0 2.20 eof}
test textDisp-9.8 {TkTextRedrawTag} -body {
@@ -1477,9 +1470,9 @@ test textDisp-9.8 {TkTextRedrawTag} -body {
.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"
.t tag add big 1.0 2.0
- updateText
+ update
.t tag add big 2.0 2.5
- updateText
+ update
set tk_textRedraw
# glob matching is to have some tolerance on actually used font size
# while still testing what we want to test
@@ -1489,9 +1482,9 @@ test textDisp-9.9 {TkTextRedrawTag} -body {
.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"
.t tag add big 1.0 2.0
- updateText
+ update
.t tag add big 1.5 2.5
- updateText
+ update
set tk_textRedraw
# glob matching is to have some tolerance on actually used font size
# while still testing what we want to test
@@ -1501,10 +1494,10 @@ test textDisp-9.10 {TkTextRedrawTag} {
.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"
.t tag add big 1.0 2.0
- updateText
+ update
set tk_textRedraw none
.t tag add big 1.3 1.5
- updateText
+ update
set tk_textRedraw
} none
test textDisp-9.11 {TkTextRedrawTag} {
@@ -1512,9 +1505,9 @@ test textDisp-9.11 {TkTextRedrawTag} {
.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"
.t tag add big 1.0 2.0
- updateText
+ update
.t tag add big 1.0 2.0
- updateText
+ update
set tk_textRedraw
} {}
test textDisp-9.12 {TkTextRedrawTag} {
@@ -1525,9 +1518,9 @@ test textDisp-9.12 {TkTextRedrawTag} {
}
.t tag configure hidden -elide true
.t tag add hidden 2.6 3.6
- updateText
+ update
.t tag add hidden 3.11 4.6
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {2.0 {2.0 eof}}
test textDisp-9.13 {TkTextRedrawTag} {
@@ -1540,9 +1533,9 @@ test textDisp-9.13 {TkTextRedrawTag} {
.t tag add hidden 6.8 7.17
.t tag configure hidden -background red
.t tag configure hidden -elide true
- updateText
+ update
.t tag configure hidden -elide false
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 6.0 7.0} {2.0 6.0 7.0}}
test textDisp-9.14 {TkTextRedrawTag} {
@@ -1552,7 +1545,7 @@ test textDisp-9.14 {TkTextRedrawTag} {
}
.tnocrash tag configure mytag1 -relief raised
.tnocrash tag configure mytag2 -relief solid
- updateText
+ update
proc doit {} {
.tnocrash tag add mytag1 4.0 5.0
.tnocrash tag add mytag2 4.0 5.0
@@ -1574,9 +1567,9 @@ test textDisp-10.1 {TkTextRelayoutWindow} {
.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"
- updateText
+ update
.t configure -bg black
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 2.0 2.20 3.0 3.20 4.0} {borders 1.0 2.0 2.20 3.0 3.20 4.0 eof}}
.t configure -bg [lindex [.t configure -bg] 3]
@@ -1590,7 +1583,7 @@ test textDisp-10.2 {TkTextRelayoutWindow} {
.top.t see insert
tkwait visibility .top.t
place .top.t -width 150 -height 100
- updateText
+ update
.top.t index @0,0
} {1.0}
catch {destroy .top}
@@ -1600,96 +1593,96 @@ catch {destroy .top}
for {set i 2} {$i <= 200} {incr i} {
.t insert end "\nLine $i"
}
-updateText
+update
test textDisp-11.1 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t index @0,0
} {30.0}
test textDisp-11.2 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t yview 32.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
test textDisp-11.3 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t yview 28.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
test textDisp-11.4 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t yview 31.4
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {31.0 40.0}
test textDisp-11.5 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 31.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {30.0 {}}
test textDisp-11.6 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 28.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
test textDisp-11.7 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 26.0
- updateText
+ update
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} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 41.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
test textDisp-11.9 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 43.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {38.0 {40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0}}
test textDisp-11.10 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview 10000.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {191.0 {191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0}}
test textDisp-11.11 {TkTextSetYView} {
.t yview 195.0
- updateText
+ update
set tk_textRedraw {}
.t yview 197.0
- updateText
+ update
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} {
.t insert 10.0 "Long line with enough text to wrap\n"
.t yview 1.0
- updateText
+ update
set tk_textRedraw {}
.t see 10.30
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {2.0 10.20}
.t delete 10.0 11.0
@@ -1703,15 +1696,15 @@ test textDisp-11.13 {TkTestSetYView, partially visible last line} {
for {set i 2} {$i <= 100} {incr i} {
.top.t insert end "\nLine $i"
}
- updateText
+ update
scan [wm geometry .top] "%dx%d" w2 h2
wm geometry .top ${w2}x[expr {$h2-2}]
- updateText
+ update
.top.t yview 1.0
- updateText
+ update
set tk_textRedraw {}
.top.t see 5.0
- updateText
+ update
# Note, with smooth scrolling, the results of this test
# have changed, and the old '2.0 {5.0 6.0}' is quite wrong.
list [.top.t index @0,0] $tk_textRedraw
@@ -1725,29 +1718,29 @@ pack .top.t
for {set i 2} {$i <= 20} {incr i} {
.top.t insert end "\nLine $i"
}
-updateText
+update
test textDisp-11.14 {TkTextSetYView, only a few lines visible} {
.top.t yview 5.0
- updateText
+ update
.top.t see 10.0
.top.t index @0,0
} {8.0}
test textDisp-11.15 {TkTextSetYView, only a few lines visible} {
.top.t yview 5.0
- updateText
+ update
.top.t see 11.0
.top.t index @0,0
# The index 9.0 should be just visible by a couple of pixels
} {9.0}
test textDisp-11.16 {TkTextSetYView, only a few lines visible} {
.top.t yview 8.0
- updateText
+ update
.top.t see 5.0
.top.t index @0,0
} {5.0}
test textDisp-11.17 {TkTextSetYView, only a few lines visible} {
.top.t yview 8.0
- updateText
+ update
.top.t see 4.0
.top.t index @0,0
# The index 2.0 should be just visible by a couple of pixels
@@ -1762,7 +1755,7 @@ test textDisp-11.18 {TkTextSetYView, see in elided lines} {
.top.t tag add hidden 4.10 "4.10 lineend"
.top.t tag add hidden 5.15 10.3
.top.t tag configure hidden -elide true
- updateText
+ update
.top.t see "8.0 lineend"
# The index "8.0 lineend" is on screen despite elided -> no scroll
.top.t index @0,0
@@ -1782,19 +1775,19 @@ test textDisp-11.19 {TkTextSetYView, see in elided lines} {
# Indices 21.0, 17.0 and 15.0 are all on the same display line
# therefore index @0,0 shall be the same for all of them
.top.t see end
- updateText
+ update
.top.t see 21.0
- updateText
+ update
set ind1 [.top.t index @0,0]
.top.t see end
- updateText
+ update
.top.t see 17.0
- updateText
+ update
set ind2 [.top.t index @0,0]
.top.t see end
- updateText
+ update
.top.t see 15.0
- updateText
+ update
set ind3 [.top.t index @0,0]
list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}]
} {1 1}
@@ -1817,7 +1810,7 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height}
}
set lineheight [font metrics [.top.t cget -font] -linespace]
wm geometry .top 200x[expr {$lineheight / 2}]
- updateText
+ update
.top.t see 1.0
.top.t index @0,[expr {$lineheight - 2}]
} {1.0}
@@ -1829,9 +1822,9 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} {
pack [.top.t peer create .top.p] -side left
pack [scrollbar .top.sb -command {.top.p yview}] -side left -fill y
.top.p configure -startline 5 -endline 35 -yscrollcommand {.top.sb set}
- updateText
+ update
.top.p yview moveto 0
- updateText
+ update
set res [.top.p get @0,0 "@0,0 lineend"]
destroy .top.p
set res
@@ -1842,38 +1835,38 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} {
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
test textDisp-12.1 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 52.0
- updateText
+ update
.t index @0,0
} {49.0}
test textDisp-12.2 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 53.0
- updateText
+ update
.t index @0,0
} {50.0}
test textDisp-12.3 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 50.10
- updateText
+ update
.t index @0,0
} {45.0}
.t configure -wrap none
test textDisp-12.4 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 53.0
- updateText
+ update
.t index @0,0
} {48.0}
test textDisp-12.5 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 50.10
- updateText
+ update
.t index @0,0
} {45.0}
@@ -1896,7 +1889,7 @@ test textDisp-13.3 {TkTextSeeCmd procedure} {
test textDisp-13.4 {TkTextSeeCmd procedure} {
.t xview moveto 0
.t yview moveto 0
- updateText
+ update
.t see 4.2
.t index @0,0
} {1.0}
@@ -1904,7 +1897,7 @@ test textDisp-13.5 {TkTextSeeCmd procedure} {
.t configure -wrap char
.t xview moveto 0
.t yview moveto 0
- updateText
+ update
.t see 12.1
.t index @0,0
} {3.0}
@@ -1912,7 +1905,7 @@ test textDisp-13.6 {TkTextSeeCmd procedure} {
.t configure -wrap char
.t xview moveto 0
.t yview moveto 0
- updateText
+ update
.t see 30.50
set x [.t index @0,0]
.t configure -wrap none
@@ -1923,7 +1916,7 @@ test textDisp-13.7 {TkTextSeeCmd procedure} {
.t yview moveto 0
.t tag add sel 30.20
.t tag add sel 30.40
- updateText
+ update
.t see 30.50
.t yview 25.0
.t see 30.50
@@ -1943,7 +1936,7 @@ test textDisp-13.8 {TkTextSeeCmd procedure} {
.t yview moveto 0
.t tag add sel 30.20
.t tag add sel 30.50
- updateText
+ update
.t see 30.50
set x [list [.t bbox 30.50]]
.t see 30.60
@@ -1967,7 +1960,7 @@ test textDisp-13.9 {TkTextSeeCmd procedure} {
.t yview moveto 0
.t tag add sel 30.20
.t tag add sel 30.50
- updateText
+ update
.t see 30.50
set x [list [.t bbox 30.50]]
.t see 30.60
@@ -2006,13 +1999,13 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} {
.top2.t2 insert end [string repeat "Line $i: éèàçù" 5]\n
}
wm geometry .top2 300x200+0+0
- updateText
+ update
.top2.t2 see "1.0 lineend"
- updateText
+ update
set ref [.top2.t2 index @0,0]
.top2.t2 insert "1.0 lineend" ç
.top2.t2 see "1.0 lineend"
- updateText
+ update
set new [.top2.t2 index @0,0]
set res [.top2.t2 compare $ref == $new]
destroy .top2
@@ -2023,7 +2016,7 @@ wm geom . {}
.t configure -wrap none
test textDisp-14.1 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- updateText
+ update
.t insert end xxxxxxxxx\n
.t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
@@ -2033,7 +2026,7 @@ test textDisp-14.1 {TkTextXviewCmd procedure} {
.t configure -wrap char
test textDisp-14.2 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- updateText
+ update
.t insert end xxxxxxxxx\n
.t insert end "xxxxx\n"
.t insert end "xxxx"
@@ -2042,7 +2035,7 @@ test textDisp-14.2 {TkTextXviewCmd procedure} {
.t configure -wrap none
test textDisp-14.3 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- updateText
+ update
.t insert end xxxxxxxxx\n
.t insert end "xxxxx\n"
.t insert end "xxxx"
@@ -2135,43 +2128,43 @@ for {set i 1} {$i < 99} {incr i} {
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
test textDisp-15.1 {ScrollByLines procedure, scrolling backwards} {
.t yview 45.0
- updateText
+ update
.t yview scroll -3 units
.t index @0,0
} {42.0}
test textDisp-15.2 {ScrollByLines procedure, scrolling backwards} {
.t yview 51.0
- updateText
+ update
.t yview scroll -2 units
.t index @0,0
} {50.20}
test textDisp-15.3 {ScrollByLines procedure, scrolling backwards} {
.t yview 51.0
- updateText
+ update
.t yview scroll -4 units
.t index @0,0
} {49.0}
test textDisp-15.4 {ScrollByLines procedure, scrolling backwards} {
.t yview 50.20
- updateText
+ update
.t yview scroll -2 units
.t index @0,0
} {49.0}
test textDisp-15.5 {ScrollByLines procedure, scrolling backwards} {
.t yview 50.40
- updateText
+ update
.t yview scroll -2 units
.t index @0,0
} {50.0}
test textDisp-15.6 {ScrollByLines procedure, scrolling backwards} {
.t yview 3.2
- updateText
+ update
.t yview scroll -5 units
.t index @0,0
} {1.0}
test textDisp-15.7 {ScrollByLines procedure, scrolling forwards} {
.t yview 48.0
- updateText
+ update
.t yview scroll 4 units
.t index @0,0
} {50.40}
@@ -2197,7 +2190,7 @@ test textDisp-15.8 {Scrolling near end of window} {
for {set i 1} {$i < $textheight} {incr i} {
.tf.f.t insert end "\nLine $i"
}
- updateText
+ update
set refind [.tf.f.t index @0,[winfo height .tf.f.t]]
# Should scroll and should not crash!
.tf.f.t yview scroll 1 unit
@@ -2217,7 +2210,7 @@ for {set i 2} {$i <= 200} {incr i} {
.t tag add big 100.0 105.0
.t insert 151.end { has a lot of extra text, so that it wraps around on the screen several times over.}
.t insert 153.end { also has largely enough extra text to wrap.}
-updateText
+update
set totpix [.t count -update -ypixels 1.0 end]
# check that the wrapping lines wrap exactly 6 times in total (4 times for line 151, and twice for line 153),
# this is an assumption of the upcoming tests
@@ -2245,7 +2238,7 @@ test textDisp-16.5 {TkTextYviewCmd procedure} {
} {1 {bad option "-bogus": must be moveto or scroll}}
test textDisp-16.6 {TkTextYviewCmd procedure, integer position} {
.t yview 100.0
- updateText
+ update
.t yview 98
.t index @0,0
} {99.0}
@@ -2329,7 +2322,7 @@ test textDisp-16.18 {TkTextYviewCmd procedure, "moveto" roundoff} {
text .top1.t -height 3 -width 4 -wrap none -setgrid 1 -padx 6 \
-spacing3 6
pack .top1.t
- updateText
+ update
.top1.t insert end "1\n2\n3\n4\n5\n6"
.top1.t yview moveto 0.3333
set result [.top1.t yview]
@@ -2350,7 +2343,7 @@ test textDisp-16.21.2 {TkTextYviewCmd procedure, "scroll" option} {
} {1 {expected floating-point number but got "bogus"}}
test textDisp-16.22 {TkTextYviewCmd procedure, "scroll" option, back pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll -1 pages
.t index @0,0
} {42.0}
@@ -2359,13 +2352,13 @@ test textDisp-16.22.1 {TkTextYviewCmd procedure, "scroll" option, back pages} {
} {1 {ambiguous argument "p": must be pages, pixels, or units}}
test textDisp-16.23 {TkTextYviewCmd procedure, "scroll" option, back pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll -3 pa
.t index @0,0
} {26.0}
test textDisp-16.24 {TkTextYviewCmd procedure, "scroll" option, back pages} {
.t yview 5.0
- updateText
+ update
.t yview scroll -3 pa
.t index @0,0
} {1.0}
@@ -2376,32 +2369,32 @@ test textDisp-16.25 {TkTextYviewCmd procedure, "scroll" option, back pages} -set
pack .f2 -side top
} -body {
.t configure -height 1
- updateText
+ update
.t yview 50.0
- updateText
+ update
.t yview scroll -1 pages
set x [.t index @0,0]
.t configure -height 10
- updateText
+ update
set x
} -cleanup {
destroy .f2
} -result {49.0}
test textDisp-16.26 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll 1 pages
.t index @0,0
} {58.0}
test textDisp-16.27 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll 2 pages
.t index @0,0
} {66.0}
test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t yview 98.0
- updateText
+ update
# The man page does not say it but the code does: scrolling 1 page actually uses the
# window height minus two lines, so that there's some overlap between adjacent pages.
# Note: it's a bit tricky but we only need to subtract one [bo] from [winfo height .t] here
@@ -2412,24 +2405,24 @@ test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
} {1}
test textDisp-16.29 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t configure -height 1
- updateText
+ update
.t yview 50.0
- updateText
+ update
.t yview scroll 1 pages
set x [.t index @0,0]
.t configure -height 10
- updateText
+ update
set x
} {51.0}
test textDisp-16.30 {TkTextYviewCmd procedure, "scroll units" option} {
.t yview 45.0
- updateText
+ update
.t yview scroll -3 units
.t index @0,0
} {42.0}
test textDisp-16.31 {TkTextYviewCmd procedure, "scroll units" option} {
.t yview 149.0
- updateText
+ update
.t yview scroll 4 units
.t index @0,0
} {151.40}
@@ -2534,7 +2527,7 @@ test textDisp-16.42 {TkTextYviewCmd procedure with indices in elided lines} {
.t tag configure hidden -elide true
.t yview 35.0
.t yview scroll [expr {- 15 * $fixedHeight}] pixels
- updateText
+ update
.t index @0,0
} {5.0}
test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} {
@@ -2548,7 +2541,7 @@ test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} {
.t tag configure hidden -elide true
.t yview 35.0
.t yview scroll -15 units
- updateText
+ update
.t index @0,0
} {5.0}
test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} {
@@ -2559,9 +2552,9 @@ test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} {
.t insert end "$x 1111\n$x 2222\n$x 3333\n$x 4444\n$x 5555\n$x 6666" hidden
}
.t tag configure hidden -elide true ; # 5 hidden lines
- updateText
+ update
.t see [expr {5 + [winfo height .t] / $fixedHeight + 1}].0
- updateText
+ update
.t index @0,0
} {2.0}
@@ -2589,83 +2582,83 @@ test textDisp-17.5 {TkTextScanCmd procedure} {
test textDisp-17.6 {TkTextScanCmd procedure} {
.t yview 1.0
.t xview moveto 0
- updateText
+ update
set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]]
.t scan mark 40 60
.t scan dragto 35 55
- updateText
+ update
lequal [.t index @0,0] $expected
} {1}
test textDisp-17.7 {TkTextScanCmd procedure} {
# 1st result
.t yview 1.0
.t xview moveto 0
- updateText
+ update
set expected [.t index @[expr {[bo]+20*$fixedWidth-50}],[expr {[bo]+9*$fixedHeight-50}]]
.t yview 10.0
.t xview scroll 20 units
- updateText
+ update
.t scan mark -10 60
.t scan dragto -5 65
- updateText
+ update
set x [.t index @0,0]
# 2nd result
.t yview 1.0
.t xview moveto 0
- updateText
+ update
lappend expected [.t index @[expr {[bo]+20*$fixedWidth-50-50}],[expr {[bo]+9*$fixedHeight-50-70}]]
.t yview 10.0
.t xview scroll 20 units
- updateText
+ update
.t scan mark -10 60
.t scan dragto -5 65
- updateText
+ update
.t scan dragto 0 72
- updateText
+ update
lequal [list $x [.t index @0,0]] $expected
} {1}
test textDisp-17.8 {TkTextScanCmd procedure} {
.t yview 1.0
.t xview moveto 0
- updateText
+ update
set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]]
.t scan mark 0 60
.t scan dragto 30 100
- updateText
+ update
.t scan dragto 25 95
- updateText
+ update
lequal [.t index @0,0] $expected
} {1}
test textDisp-17.9 {TkTextScanCmd procedure} {
.t yview end
.t xview moveto 0
- updateText
+ update
# this brings us at lower right corner of the text
.t xview scroll 100 units
- updateText
+ update
# this does not trigger any scroll, we're already at the corner
.t scan mark 90 60
.t scan dragto 10 0
- updateText
+ update
set expected [.t index @[expr {[winfo width .t]-[bo]-40}],[expr {[winfo height .t]-[bo]-50}]]
set expected [.t index "$expected - [.t cget -height] lines - [.t cget -width] chars"]
.t scan dragto 14 5
- updateText
+ update
lequal [.t index @0,0] $expected
} {1}
.t configure -wrap word
test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} {
.t yview 10.0
- updateText
+ update
set origin [.t index @0,0]
set expected [.t index "$origin - [expr {int(ceil(50.0/$fixedHeight))}] display lines"]
.t scan mark -10 60
.t scan dragto -5 65
- updateText
+ update
set x [.t index @0,0]
lappend expected [.t index "$origin - [expr {int(ceil((50.0+70.0)/$fixedHeight))}] display lines"]
.t scan dragto 0 72
- updateText
+ update
lequal [list $x [.t index @0,0]] $expected
} {1}
.t configure -xscrollcommand scroll -yscrollcommand {}
@@ -2676,7 +2669,7 @@ test textDisp-18.1 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
test textDisp-18.2 {GetXView procedure} {
@@ -2685,13 +2678,13 @@ test textDisp-18.2 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-18.3 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-18.4 {GetXView procedure} {
@@ -2700,7 +2693,7 @@ test textDisp-18.4 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxx\n
.t insert end xxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-18.5 {GetXView procedure} {
@@ -2710,7 +2703,7 @@ test textDisp-18.5 {GetXView procedure} {
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
.t xview scroll 31 units
- updateText
+ update
set scrollInfo
} [list [expr {31.0/55}] [expr {51.0/55}]]
test textDisp-18.6 {GetXView procedure} {
@@ -2721,27 +2714,27 @@ test textDisp-18.6 {GetXView procedure} {
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
.t xview moveto 0
.t xview scroll 31 units
- updateText
+ update
set x {}
lappend x $scrollInfo
.t configure -wrap char
- updateText
+ update
lappend x $scrollInfo
.t configure -wrap word
- updateText
+ update
lappend x $scrollInfo
.t configure -wrap none
- updateText
+ update
lappend x $scrollInfo
} [list [list [expr {31.0/56}] [expr {51.0/56}]] {0.0 1.0} {0.0 1.0} [list 0.0 [expr {5.0/14}]]]
test textDisp-18.7 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
- updateText
+ update
set scrollInfo unchanged
.t insert end xxxxxx\n
.t insert end xxx
- updateText
+ update
set scrollInfo
} {unchanged}
test textDisp-18.8 {GetXView procedure} {
@@ -2755,10 +2748,10 @@ test textDisp-18.8 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
- updateText
+ update
.t delete 1.0 end
.t configure -xscrollcommand scrollError
- updateText
+ update
set x
} {{scrolling error} {scrolling error
while executing
@@ -2774,37 +2767,37 @@ catch {rename bogus {}}
test textDisp-19.1 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-19.2 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
set scrollInfo "unchanged"
.t insert 1.0 "Line1\nLine2"
- updateText
+ update
set scrollInfo
} {unchanged}
test textDisp-19.3 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
set scrollInfo "unchanged"
.t insert 1.0 "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
set scrollInfo
} {unchanged}
test textDisp-19.4 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
- updateText
+ update
set scrollInfo "unchanged"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13} {
.t insert end "\nLine $i"
}
- updateText
+ update
set scrollInfo
} [list 0.0 [expr {70.0/91}]]
test textDisp-19.5 {GetYView procedure} {
@@ -2815,7 +2808,7 @@ test textDisp-19.5 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t insert 2.end " is really quite long; in fact it's so long that it wraps three times"
- updateText
+ update
set x $scrollInfo
} {0.0 0.625}
test textDisp-19.6 {GetYView procedure} {
@@ -2827,7 +2820,7 @@ test textDisp-19.6 {GetYView procedure} {
}
.t insert 2.end " is really quite long; in fact it's so long that it wraps three times"
.t yview 4.0
- updateText
+ update
set x $scrollInfo
} {0.375 1.0}
test textDisp-19.7 {GetYView procedure} {
@@ -2839,7 +2832,7 @@ test textDisp-19.7 {GetYView procedure} {
}
.t insert 2.end " is really quite long; in fact it's so long that it wraps three times"
.t yview 2.26
- updateText
+ update
set x $scrollInfo
} {0.125 0.75}
test textDisp-19.8 {GetYView procedure} {
@@ -2851,7 +2844,7 @@ test textDisp-19.8 {GetYView procedure} {
}
.t insert 10.end " is really quite long; in fact it's so long that it wraps three times"
.t yview 2.0
- updateText
+ update
.t count -update -ypixels 1.0 end
set x $scrollInfo
} {0.0625 0.6875}
@@ -2863,7 +2856,7 @@ test textDisp-19.9 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t yview 3.0
- updateText
+ update
set scrollInfo
} [list [expr {4.0/30}] 0.8]
test textDisp-19.10 {GetYView procedure} {
@@ -2874,7 +2867,7 @@ test textDisp-19.10 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t yview 11.0
- updateText
+ update
set scrollInfo
} [list [expr {1.0/3}] 1.0]
test textDisp-19.10.1 {Widget manipulation causes height miscount} {
@@ -2885,7 +2878,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} {
.t insert end "\nLine $i"
}
.t yview 11.0
- updateText
+ update
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Line 1"
@@ -2895,7 +2888,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
.t yview insert
- updateText
+ update
.t count -update -ypixels 1.0 end
set scrollInfo
} {0.5 1.0}
@@ -2909,7 +2902,7 @@ test textDisp-19.11 {GetYView procedure} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
.t yview insert
- updateText
+ update
.t count -update -ypixels 1.0 end
set scrollInfo
} {0.5 1.0}
@@ -3047,10 +3040,10 @@ test textDisp-19.12 {GetYView procedure, partially visible last line} {
pack .top.t -expand yes -fill both
.top.t insert end "Line 1\nLine 2\nLine 3\nLine 4\nLine 5"
# Need to wait for asychronous calculations to complete.
- updateText
+ update
scan [wm geom .top] %dx%d twidth theight
wm geom .top ${twidth}x[expr {$theight - 3}]
- updateText
+ update
.top.t yview
} [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]]
test textDisp-19.13 {GetYView procedure, partially visible last line} {
@@ -3061,10 +3054,10 @@ test textDisp-19.13 {GetYView procedure, partially visible last line} {
pack .top.t -expand yes -fill both
.top.t insert end "Line 1\nLine 2\nLine 3\nLine 4 has enough text to wrap around at least once"
# Need to wait for asychronous calculations to complete.
- updateText
+ update
scan [wm geom .top] %dx%d twidth theight
wm geom .top ${twidth}x[expr {$theight - 3}]
- updateText
+ update
.top.t yview
} [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]]
catch {destroy .top}
@@ -3078,14 +3071,14 @@ test textDisp-19.14 {GetYView procedure} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
# Need to update so everything is calculated.
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ delay
set scrollInfo "unchanged"
.t mark set insert 3.0
.t tag configure x -background red
.t tag add x 1.0 5.0
- updateText
+ update
.t tag delete x
set scrollInfo
} {unchanged}
@@ -3098,14 +3091,14 @@ test textDisp-19.15 {GetYView procedure} {
}
.t insert end "\nThis last line wraps around four "
.t insert end "times with a bit little left on the last line."
- updateText
+ update
.t configure -yscrollcommand scrollError
proc bgerror args {
global x errorInfo errorCode
set x [list $args $errorInfo $errorCode]
}
.t delete 1.0 end
- updateText
+ update
rename bgerror {}
.t configure -yscrollcommand scroll
set x
@@ -3127,9 +3120,9 @@ test textDisp-19.16 {count -ypixels} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
# Need to update so everything is calculated.
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ update
set res [list \
[.t count -ypixels 1.0 end] \
[.t count -update -ypixels 1.0 end] \
@@ -3152,9 +3145,9 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} {
}
.t tag add hidden 5.15 20.15
.t tag configure hidden -elide true
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ update
set res [list \
[.t count -ypixels 1.0 6.0] \
[.t count -ypixels 2.0 7.5] \
@@ -3188,12 +3181,12 @@ test textDisp-19.18 {count -ypixels with indices in elided lines} {
.t tag add hidden 5.15 20.15
.t tag configure hidden -elide true
.t yview 35.0
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ update
set res [.t count -ypixels 5.0 25.0]
.t yview scroll [expr {- 15 * $fixedHeight}] pixels
- updateText
+ update
lappend res [.t count -ypixels 5.0 25.0]
} [list [expr {5 * $fixedHeight}] [expr {5 * $fixedHeight}]]
test textDisp-19.19 {count -ypixels with indices in elided lines} {
@@ -3206,7 +3199,7 @@ test textDisp-19.19 {count -ypixels with indices in elided lines} {
.t tag add hidden 5.27 11.0
.t tag configure hidden -elide true
.t yview 5.0
- updateText
+ update
set res [list [.t count -ypixels 5.0 11.0] [.t count -ypixels 5.0 11.20]]
} [list [expr {1 * $fixedHeight}] [expr {2 * $fixedHeight}]]
.t delete 1.0 end
@@ -3315,7 +3308,7 @@ 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"
-updateText
+update
.t tag add x 50.1
test textDisp-22.1 {TkTextCharBbox} {
.t config -wrap word
@@ -3336,58 +3329,58 @@ test textDisp-22.2 {TkTextCharBbox} {
[list [xchar 0] [yline 10] $fixedWidth $fixedHeight]]
test textDisp-22.3 {TkTextCharBbox, cut-off lines} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height-1}]
- updateText
+ update
set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \
[list [xchar 1] [yline 11] $fixedWidth [expr {($height-1)-$oriHeight}]]]
lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected
} {1}
test textDisp-22.4 {TkTextCharBbox, cut-off lines} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height+1}]
- updateText
+ update
set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \
[list [xchar 1] [yline 11] $fixedWidth [expr {($height+1)-$oriHeight}]]]
lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected
} {1}
test textDisp-22.5 {TkTextCharBbox, cut-off char} {
wm geometry . {}
- updateText
+ update
.t config -wrap none
.t yview 10.0
wm geom . [expr {$width-(20-7)*$fixedWidth}]x$height
- updateText
+ update
.t bbox 15.6
} [list [xchar 6] [yline 6] $fixedWidth $fixedHeight]
test textDisp-22.6 {TkTextCharBbox, line visible but not char} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
.t tag add big 20.2 20.5
wm geom . ${width}x[expr {$height+3}]
- updateText
+ update
set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \
{} \
[list [xchar 2] [yline 11] [font measure $bigFont "n"] [expr {($height+3)-$oriHeight}]]]
lequal [list [.t bbox 19.1] [.t bbox 20.1] [.t bbox 20.2]] $expected
} {1}
wm geom . {}
-updateText
+update
test textDisp-22.7 {TkTextCharBbox, different character sizes} {
.t config -wrap char
.t yview 10.0
.t tag add big 12.2 12.5
- updateText
+ update
list [.t bbox 12.1] [.t bbox 12.2]
} [list [list [xchar 1] [expr {[yline 3]+$ascentDiff}] $fixedWidth $fixedHeight] \
[list [xchar 2] [yline 3] [font measure $bigFont "n"] $bigHeight]]
@@ -3420,7 +3413,7 @@ test textDisp-22.9 {TkTextCharBbox, handling of spacing} {
.t window create 1.7 -window .t.f2 -align center
.t window create 2.1 -window .t.f3 -align bottom
.t window create 2.10 -window .t.f4 -align baseline
- updateText
+ update
list [.t bbox .t.f1] [.t bbox .t.f2] [.t bbox .t.f3] [.t bbox .t.f4] \
[.t bbox 1.1] [.t bbox 2.9]
} [list [list [xchar 3] [expr {[yline 1]+8}] 10 4] \
@@ -3439,7 +3432,7 @@ test textDisp-22.10 {TkTextCharBbox, handling of elided lines} {
.t tag add hidden 2.8 2.13
.t tag add hidden 6.8 7.13
.t tag configure hidden -elide true
- updateText
+ update
list \
[expr {[lindex [.t bbox 2.9] 0] - [lindex [.t bbox 2.8] 0]}] \
[expr {[lindex [.t bbox 2.10] 0] - [lindex [.t bbox 2.8] 0]}] \
@@ -3461,7 +3454,7 @@ test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} {
}
.t tag add hidden 1.30 2.5
.t tag configure hidden -elide true
- updateText
+ update
list \
[expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.4] 0]}] \
[expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.5] 0]}]
@@ -3475,7 +3468,7 @@ 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"
-updateText
+update
test textDisp-23.1 {TkTextDLineInfo} {
.t config -wrap word
.t yview 48.0
@@ -3488,44 +3481,44 @@ test textDisp-23.1 {TkTextDLineInfo} {
.t config -bd 4
test textDisp-23.2 {TkTextDLineInfo} {
.t config -wrap word
- updateText
+ update
.t yview 48.0
.t dlineinfo 50.40
} [list [bo] [yline 5] [xw 13] $fixedHeight $fixedAscent]
.t config -bd 0
test textDisp-23.3 {TkTextDLineInfo} {
.t config -wrap none
- updateText
+ update
.t yview 48.0
list [.t dlineinfo 50.40] [.t dlineinfo 57.3]
} [list [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \
[list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent]]
test textDisp-23.4 {TkTextDLineInfo, cut-off lines} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height-1}]
- updateText
+ update
set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \
[list [bo] [yline 11] [xw 7] [expr {($height-1)-$oriHeight}] $fixedAscent]]
lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected
} {1}
test textDisp-23.5 {TkTextDLineInfo, cut-off lines} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height+1}]
- updateText
+ update
set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \
[list [bo] [yline 11] [xw 7] [expr {($height+1)-$oriHeight}] $fixedAscent]]
lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected
} {1}
wm geom . {}
-updateText
+update
test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {
.t config -wrap none
.t delete 1.0 end
@@ -3533,7 +3526,7 @@ test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {
.t insert end "Second line is a very long one that doesn't all fit.\n"
.t insert end "Third"
.t xview scroll 6 units
- updateText
+ update
list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0]
} [list [list [expr {[xw -6]+[bo]}] [yline 1] [xw 10] $fixedHeight $fixedAscent] \
[list [expr {[xw -6]+[bo]}] [yline 2] [xw 52] $fixedHeight $fixedAscent] \
@@ -3564,7 +3557,7 @@ test textDisp-24.1 {TkTextCharLayoutProc} {
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
test textDisp-24.2 {TkTextCharLayoutProc} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
@@ -3575,20 +3568,20 @@ test textDisp-24.2 {TkTextCharLayoutProc} {
incr wi -$fixedWidth
}
wm geom . [expr {$wi+1}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
} {1}
test textDisp-24.3 {TkTextCharLayoutProc} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . [expr {$width-1}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
@@ -3598,7 +3591,7 @@ test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {
.t delete 1.0 end
.t insert 1.0 01234567890123456789\n012345678901234567890
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20] [.t bbox 2.20]
} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
[list [xchar 20] [yline 1] 0 $fixedHeight] \
@@ -3611,7 +3604,7 @@ test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible}
# note: windows refuses to shrink enough therefore the constraint
set wi [expr {[winfo width .f]+[bo]+[xw 1]}]
wm geom . ${wi}x$height
- updateText
+ update
list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 2.0]
} [list [list [xchar 0] [yline 1] [expr {$fixedWidth-[bo]}] $fixedHeight] \
[list [expr {[xchar 1]-[bo]}] [yline 1] 0 $fixedHeight] \
@@ -3621,13 +3614,13 @@ test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} {
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20]
} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
@@ -3638,46 +3631,46 @@ test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {
incr wi -$fixedWidth
}
wm geom . [expr {$wi+1}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
} {1}
test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . [expr {$width-1}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
} {1}
test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . [expr {$width-6}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-6-$oriWidth)}] $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
} {1}
test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . [expr {$width-7}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-7-$oriWidth)}] $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
@@ -3689,7 +3682,7 @@ test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't qui
# set text widget width to 2 pixels more than 20-char width
set wi [expr {[winfo width .f]+2*[bo]+[xw 20]+2}]
wm geom . ${wi}x$height
- updateText
+ update
set result [list [.t bbox 1.21] [.t bbox 2.0]]
.t mark set insert 1.21
lappend result [.t bbox 1.21] [.t bbox 2.0]
@@ -3698,7 +3691,7 @@ test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't qui
[list [expr {[xchar 20]+2}] [yline 1] 0 $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
wm geom . {}
-updateText
+update
test textDisp-24.12 {TkTextCharLayoutProc, tab causes wrap} {
.t configure -wrap char
.t delete 1.0 end
@@ -3714,31 +3707,31 @@ test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} {
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20]
} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] {}]
test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap none
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . [expr {$width+1}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
[list [xchar 20] [yline 1] [expr {$width+1-$oriWidth}] $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
} {1}
test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {
wm geometry . {}
- updateText
+ update
scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap none
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . [expr {$width-1}]x$height
- updateText
+ update
set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
[list [xchar 20] [yline 1] [expr {$width-1-$oriWidth}] $fixedHeight]]
lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
@@ -3753,7 +3746,7 @@ test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {
# set text widget width to [bo] pixels (no chars fit in the widget at all)
set wi [expr {[winfo width .f]+[bo]}]
wm geom . ${wi}x$height
- updateText
+ update
list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2]
} [list [list [xchar 0] [yline 1] 1 $fixedHeight] \
[list [xchar 0] [yline 2] 1 $fixedHeight] \
@@ -3766,7 +3759,7 @@ test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} {
.t delete 1.0 end
.t insert 1.0 "This is a line that wraps around"
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20]
} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
[list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
@@ -3775,7 +3768,7 @@ test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} {
.t delete 1.0 end
.t insert 1.0 "xxThis is a line that wraps around"
wm geom . {}
- updateText
+ update
list [.t bbox 1.15] [.t bbox 1.16] [.t bbox 1.17] [.t bbox 1.21]
} [list [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \
[list [xchar 16] [yline 1] [xe 16] $fixedHeight] \
@@ -3786,7 +3779,7 @@ test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} {
.t delete 1.0 end
.t insert 1.0 "xxThis is a line that wraps around"
wm geom . {}
- updateText
+ update
list [.t bbox 1.14] [.t bbox 1.15] [.t bbox 1.16]
} [list [list [xchar 14] [yline 1] $fixedWidth $fixedHeight] \
[list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \
@@ -3811,7 +3804,7 @@ test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {
[list [xchar 1] [expr {[yline 2]+2}] $fixedWidth $fixedHeight] \
[list [bo] [yline 2] [xw 6] [expr {$fixedHeight+2}] $fixedAscent]]
.t configure -width 30
-updateText
+update
test textDisp-24.21 {TkTextCharLayoutProc, word breaks} {
.t configure -wrap word
.t delete 1.0 end
@@ -3841,7 +3834,7 @@ test textDisp-24.23 {TkTextCharLayoutProc, word breaks} {
} [list [xchar 0] [yline 3] 50 20]
catch {destroy .t.f}
.t configure -width 20
-updateText
+update
# Next test is currently constrained to not run on mac (aqua) because on
# aqua it fails due to wrong implementation of tabs with right justification
# (the text is not rendered at all). This is a bug.
@@ -3858,7 +3851,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup {
pack .tt
} -body {
.tt insert end \t9\n\t99\n\t999
- updateText
+ update
set expected [list [list [expr {[bo .tt]+40-$fixedWidth}] [yline 1 .tt] $fixedWidth $fixedHeight] \
[list [expr {[bo .tt]+40-$fixedWidth}] [yline 2 .tt] $fixedWidth $fixedHeight] \
[list [expr {[bo .tt]+40-$fixedWidth}] [yline 3 .tt] $fixedWidth $fixedHeight]]
@@ -3869,7 +3862,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup {
.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 \
-tabs 100
-updateText
+update
test textDisp-25.1 {CharBboxProc procedure, check tab width} {
.t delete 1.0 end
.t insert 1.0 abc\td\tfgh
@@ -3880,7 +3873,7 @@ test textDisp-25.1 {CharBboxProc procedure, check tab width} {
.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 -pady 0 \
-tabs {}
-updateText
+update
test textDisp-26.1 {AdjustForTab procedure, no tabs} {
.t delete 1.0 end
.t insert 1.0 a\tbcdefghij\tc\td
@@ -4007,7 +4000,7 @@ test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} {
.t tag add y 1.9
button .b -text "="
.t window create 1.3 -window .b
- updateText
+ update
lindex [.t bbox 1.5] 0
} 120
test textDisp-26.13 {AdjustForTab procedure, not enough space} {
@@ -4065,7 +4058,7 @@ test textDisp-26.14.2 {AdjustForTab procedure, not enough space} {
.t configure -width 20 -bd 2 -highlightthickness 2 -relief sunken -tabs {} \
-wrap char
-updateText
+update
test textDisp-27.1 {SizeOfTab procedure, old-style tabs} {
.t delete 1.0 end
.t insert 1.0 a\tbcdefghij\tc\td
@@ -4159,7 +4152,7 @@ test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential
# Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding,
# so must we.
set tab [expr {[bo] + int(0.5 + $tab + $cm)}]
- updateText
+ update
set res [.t bbox 2.23]
set expected [list [expr {[xchar 23]-$tab}] [yline 2] $fixedWidth $fixedHeight]
lequal [lset res 0 [expr {[lindex $res 0] - $tab}]] $expected
@@ -4180,7 +4173,7 @@ test textDisp-27.7.1 {SizeOfTab procedure, center alignment, wrap -none (potenti
# Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding,
# so must we.
set tab [expr {[bo] + int(0.5 + $tab + $cm)}]
- updateText
+ update
set res [.t bbox 2.23]
.t configure -tabstyle tabular
lset res 0 [expr {[lindex $res 0] - $tab}]
@@ -4194,17 +4187,17 @@ test textDisp-27.7.2 {SizeOfTab procedure, fractional tab interpolation problem}
}
.t configure -tabs $interpolatetab -wrap none -width 150
.t insert 1.0 [string repeat "a\t" 20]
- updateText
+ update
set res [.t bbox 1.20]
# Now, Tk's interpolated tabs should be the same as
# non-interpolated.
.t configure -tabs $precisetab
- updateText
+ update
expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]}
} 0
.t configure -wrap char -tabs {} -width 20
-updateText
+update
test textDisp-27.8 {SizeOfTab procedure, right alignment} {
.t delete 1.0 end
.t insert 1.0 a\t\txyzzyabc
@@ -4253,11 +4246,11 @@ test textDisp-28.1 {"yview" option with bizarre scroll command} -setup {
.t2.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n"
pack .t2.t
wm geometry .t2 +0+0
- updateText
+ update
.t2.t configure -yscrollcommand bizarre_scroll
.t2.t yview 100.0
set result [.t2.t index @0,0]
- updateText
+ update
lappend result [.t2.t index @0,0]
} -cleanup {
destroy .t2
@@ -4276,7 +4269,7 @@ test textDisp-29.1 {miscellaneous: lines wrap but are still too long} -setup {
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
set expected [list [list 0.0 [expr {20.0*$fixedWidth/300}]] \
300x50+[bo .t2.t]+[yline 2 .t2.t] \
[list [xchar 1 .t2.t] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]]
@@ -4297,9 +4290,9 @@ test textDisp-29.2 {miscellaneous: lines wrap but are still too long} -setup {
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 1 unit
- updateText
+ update
set expected [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] \
300x50+[expr {[bo .t2.t]-$fixedWidth}]+[yline 2 .t2.t] \
[list [expr {[bo .t2.t]-$fixedWidth+$fixedWidth}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]]
@@ -4319,9 +4312,9 @@ test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} -setup {
pack .t2.s -side bottom -fill x
.t2.t insert end 1\n
.t2.t insert end [string repeat "abc" 30]
- updateText
+ update
.t2.t xview scroll 5 unit
- updateText
+ update
.t2.t xview
} -cleanup {
destroy .t2
@@ -4339,9 +4332,9 @@ test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} -setup {
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 2 unit
- updateText
+ update
set expected [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] \
300x50+[expr {[bo .t2.t]-2*$fixedWidth}]+[yline 2 .t2.t] \
{}]
@@ -4362,9 +4355,9 @@ test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} -setup {
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 7 pixels
- updateText
+ update
set expected [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth+7)/300}]] \
300x50+[expr {[bo .t2.t]-7}]+[yline 2 .t2.t] \
[list [expr {[bo .t2.t]+$fixedWidth-7}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]]
@@ -4385,9 +4378,9 @@ test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} -setup {
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 17 pixels
- updateText
+ update
set expected [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth+17)/300}]] \
300x50+[expr {[bo .t2.t]-17}]+[yline 2 .t2.t] \
{}]
@@ -4410,7 +4403,7 @@ test textDisp-29.2.5 {miscellaneous: can show last character} -setup {
grid columnconfigure .t2 0 -weight 1
grid rowconfigure .t2 0 -weight 1
grid rowconfigure .t2 1 -weight 0
- updateText
+ update
set xv [.t2.t xview]
set xd [expr {[lindex $xv 1] - [lindex $xv 0]}]
.t2.t xview moveto [expr {1.0-$xd}]
@@ -4438,9 +4431,9 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} -setup {
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 200 units
- updateText
+ update
set expected [list [list [expr {double(300-20*$fixedWidth)/300}] 1.0] \
300x50+[expr {-(300-20*$fixedWidth-[bo .t2.t])}]+[yline 2 .t2.t] \
{}]
@@ -4459,7 +4452,7 @@ test textDisp-30.1 {elided text joining multiple logical lines} -setup {
.t2.t insert 1.0 "1111\n2222\n3333"
.t2.t tag configure elided -elide 1 -background red
.t2.t tag add elided 1.2 3.2
- updateText
+ update
.t2.t count -update -displaylines 1.0 end
} -cleanup {
destroy .t2
@@ -4474,7 +4467,7 @@ test textDisp-30.2 {elided text joining multiple logical lines} -setup {
.t2.t insert 1.0 "1111\n2222\n3333"
.t2.t tag configure elided -elide 1 -background red
.t2.t tag add elided 1.2 2.2
- updateText
+ update
.t2.t count -update -displaylines 1.0 end
} -cleanup {
destroy .t2
@@ -4482,7 +4475,7 @@ test textDisp-30.2 {elided text joining multiple logical lines} -setup {
catch {destroy .t2}
.t configure -height 1
-updateText
+update
test textDisp-31.1 {line embedded window height update} {
set res {}
@@ -4500,7 +4493,7 @@ test textDisp-31.1 {line embedded window height update} {
test textDisp-31.2 {line update index shifting} {
set res {}
.t.f configure -height 100
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
.t.f configure -height 10
.t insert 1.0 "abc\n"
@@ -4524,7 +4517,7 @@ test textDisp-31.3 {line update index shifting} {
# have been performed.
set res {}
.t.f configure -height 100
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
.t.f configure -height 10
.t insert 1.0 "abc\n"
@@ -4548,7 +4541,7 @@ test textDisp-31.4 {line embedded image height update} {
image create photo textest -height 100 -width 10
.t delete 3.0
.t image create 3.0 -image textest
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
textest configure -height 10
lappend res [.t count -ypixels 1.0 end]
@@ -4560,7 +4553,7 @@ test textDisp-31.4 {line embedded image height update} {
test textDisp-31.5 {line update index shifting} {
set res {}
textest configure -height 100
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
textest configure -height 10
.t insert 1.0 "abc\n"
@@ -4635,19 +4628,19 @@ test textDisp-32.0 {everything elided} {
.tt insert 0.0 HELLO
.tt tag configure HIDE -elide 1
.tt tag add HIDE 0.0 end
- updateText
+ update
destroy .tt
} {}
test textDisp-32.1 {everything elided} {
# Must not crash
pack [text .tt]
- updateText
+ update
.tt insert 0.0 HELLO
- updateText
+ update
.tt tag configure HIDE -elide 1
- updateText
+ update
.tt tag add HIDE 0.0 end
- updateText
+ update
destroy .tt
} {}
test textDisp-32.2 {elide and tags} {
@@ -4658,11 +4651,11 @@ test textDisp-32.2 {elide and tags} {
{testtag1 testtag3} \
{[this bit here uses tags 2 and 3]} \
{testtag2 testtag3}
- updateText
+ update
# indent left margin of tag 1 by 20 pixels
# text should be indented
.tt tag configure testtag1 -lmargin1 20
- updateText
+ update
#1
set res {}
lappend res [list [.tt index "1.0 + 0 displaychars"] \
@@ -4671,7 +4664,7 @@ test textDisp-32.2 {elide and tags} {
# hide tag 1, remaining text should not be indented, since
# the indented tag and character is hidden.
.tt tag configure testtag1 -elide 1
- updateText
+ update
#2
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4682,7 +4675,7 @@ test textDisp-32.2 {elide and tags} {
# indent left margin of tag 2 by 20 pixels
# text should not be indented, since tag1 has lmargin1 of 0.
.tt tag configure testtag2 -lmargin1 20
- updateText
+ update
#3
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4691,7 +4684,7 @@ test textDisp-32.2 {elide and tags} {
# the bbox of 1.0 should have zero width and zero indent,
# since it is elided at that position.
.tt tag configure testtag1 -elide 1
- updateText
+ update
#4
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4704,7 +4697,7 @@ test textDisp-32.2 {elide and tags} {
# precedence over testtag1, and is applied to the
# start of the text.
.tt tag configure testtag3 -lmargin1 20
- updateText
+ update
#5
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4713,7 +4706,7 @@ test textDisp-32.2 {elide and tags} {
# since it still has testtag3 on it. Again the
# bbox of 1.0 should have 0.
.tt tag configure testtag1 -elide 1
- updateText
+ update
#6
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4751,7 +4744,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup {
.tt insert end ":)" emoticon
.tt image create end -image $img
pack .tt
- updateText
+ update
} -cleanup {
image delete $img
destroy .tt
@@ -4773,20 +4766,20 @@ test textDisp-32.4 {Button-1 click with elided lines - Bug 18371b7ce7} -setup {
test textDisp-33.0 {one line longer than fits in the widget} {
pack [text .tt -wrap char]
- updateText
+ update
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
+ update
.tt see 1.0
lindex [.tt yview] 0
} {0.0}
test textDisp-33.1 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
- updateText
+ update
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
+ update
.tt yview "1.0 +1 displaylines"
- updateText
+ update
if {[lindex [.tt yview] 0] > 0.1} {
set result "window should be scrolled to the top"
} else {
@@ -4797,7 +4790,7 @@ test textDisp-33.2 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
.tt debug 1
- updateText
+ update
set tk_textHeightCalc ""
set timer [after 200 lappend tk_textHeightCalc "Timed out"]
.tt insert 1.0 [string repeat "more wrap + " 1]
@@ -4810,7 +4803,7 @@ test textDisp-33.3 {one line longer than fits in the widget} {
pack [text .tt -wrap char]
set tk_textHeightCalc ""
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
+ update
.tt sync
# Each line should have been recalculated just once
expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]}
@@ -4819,7 +4812,7 @@ test textDisp-33.4 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
+ update
set idx [.tt index "1.0 + 1 displaylines"]
.tt yview $idx
if {[lindex [.tt yview] 0] > 0.1} {
@@ -4840,7 +4833,7 @@ test textDisp-33.5 {bold or italic fonts} win {
.tt tag configure bi -font bi
.tt tag configure no -font no
.tt insert end abcd no efgh bi ijkl\n no
- updateText
+ update
set bb {}
for {set i 0} {$i < 12} {incr i 4} {
lappend bb [lindex [.tt bbox 1.$i] 0]
@@ -4866,7 +4859,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
.t1 insert end $txt
set ge [winfo geometry .]
scan $ge "%dx%d+%d+%d" width height left top
- updateText
+ update
.t1 sync
set negative 0
bind .t1 <<WidgetViewSync>> { if {%d < 0} {set negative 1} }
@@ -4876,7 +4869,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
# 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"
- updateText
+ update
.t1 sync
set negative
} -cleanup {
@@ -4914,7 +4907,7 @@ test textDisp-36.1 {Display bug with 'yview insert'} -constraints {knownBug} -se
} -body {
.t1 tag add elide 1.3 2.0
.t1 yview insert
- updateText
+ update
# wish now panics: "CalculateDisplayLineHeight called with bad indexPtr"
.t1 yview scroll -1 pixels
} -cleanup {