diff options
author | fvogel <fvogelnew1@free.fr> | 2022-09-25 18:33:34 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2022-09-25 18:33:34 (GMT) |
commit | 7f78bbbef42914118ae9253ddaeb699fe424271b (patch) | |
tree | b50dbcb4a9f635969720fa7a7dde833c5165f064 | |
parent | 2454910edb800435df819548f9745ffecdd2737a (diff) | |
download | tk-7f78bbbef42914118ae9253ddaeb699fe424271b.zip tk-7f78bbbef42914118ae9253ddaeb699fe424271b.tar.gz tk-7f78bbbef42914118ae9253ddaeb699fe424271b.tar.bz2 |
Remove proc updateWidgets since it now simply runs 'update' on all platforms.
-rw-r--r-- | tests/textDisp.test | 854 |
1 files changed, 427 insertions, 427 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test index 4a060a7..de6fd22 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -14,9 +14,9 @@ namespace import -force tcltest::test # The delay procedure needs to wait long enough for the asynchronous updates # performed by the text widget to run. proc delay {} { - updateWidgets + update after 100 - updateWidgets + update } # The procedure below is used as the scrolling command for the text; @@ -140,7 +140,7 @@ wm withdraw . wm minsize . 1 1 wm positionfrom . user wm deiconify . -updateWidgets +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 @@ -221,7 +221,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} - updateWidgets + update destroy .txt } {} @@ -234,7 +234,7 @@ test textDisp-0.4 {double tag elide transition} { .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {SYSTEM TRAFFIC} # Crash was here. - updateWidgets + update destroy .txt } {} @@ -248,7 +248,7 @@ test textDisp-0.5 {double tag elide transition} { .txt insert end "\n" {SYSTEM TRAFFIC} .txt insert end "\n" WELCOME # Crash was here. - updateWidgets + update destroy .txt } {} @@ -279,7 +279,7 @@ test textDisp-1.2 {GetStyle procedure, wrapmode} { .t tag configure x -wrap word .t tag configure y -wrap none .t tag raise y - updateWidgets + update set result [list [.t bbox 2.20]] .t tag add x 2.0 2.1 lappend result [.t bbox 2.20] @@ -351,7 +351,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 - updateWidgets + update .t configure -wrap char .t delete 1.0 end .t insert 1.0 "This isxx some sample text for testing." @@ -359,7 +359,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 . {} - updateWidgets + 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} { @@ -661,12 +661,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" - updateWidgets + update .t delete 2.0 2.end - updateWidgets + update set res $tk_textRelayout .t insert 2.0 "New Line 2" - updateWidgets + 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] \ @@ -676,13 +676,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" - updateWidgets + update .t mark set x 2.21 .t delete 2.2 - updateWidgets + update set res $tk_textRelayout .t insert 2.0 X - updateWidgets + 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] \ @@ -692,10 +692,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" - updateWidgets + update .t mark set x 2.21 .t delete 2.2 - updateWidgets + 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] \ @@ -706,7 +706,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" - updateWidgets + update list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ {} \ @@ -717,11 +717,11 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} { wm overrideredirect . 1 } wm geom . 103x$height - updateWidgets + 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" - updateWidgets + update list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout } [list [list [xchar 0] [yline 2] 1 $fixedHeight] \ {} \ @@ -744,21 +744,21 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} { frame .f2 -width 20 -height 100 pack .f2 -before .f wm geom . 103x103 - updateWidgets + 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" - updateWidgets + update set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout] wm overrideredirect . 0 - updateWidgets + 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 . {} -updateWidgets +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 @@ -773,28 +773,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 - updateWidgets + update .t yview 16.0 - updateWidgets + update set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] wm overrideredirect . 0 - updateWidgets + 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 - updateWidgets + update .t delete 5.0 14.0 - updateWidgets + 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 - updateWidgets + update .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] } [list [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \ @@ -803,18 +803,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 - updateWidgets + update .t delete 13.0 end - updateWidgets + 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 - updateWidgets + update .t delete 14.0 end - updateWidgets + 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} { @@ -823,11 +823,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 - updateWidgets + update .t yview moveto 0 - updateWidgets + update .t yview moveto 1 - updateWidgets + update winfo ismapped .b } {0} .t configure -wrap word @@ -840,33 +840,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 - updateWidgets + update .t yview scroll 3 units - updateWidgets + 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 - updateWidgets + update .t yview scroll 3 units - updateWidgets + 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 - updateWidgets + update .t yview scroll -2 units - updateWidgets + 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 - updateWidgets + update .t yview scroll -2 units - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} { @@ -874,9 +874,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" - updateWidgets + update .t xview scroll 3 units - updateWidgets + 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} \ @@ -888,9 +888,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" - updateWidgets + update .t xview scroll 100 units - updateWidgets + 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]] @@ -899,10 +899,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" - updateWidgets + update .t xview moveto 0 .t xview scroll -10 units - updateWidgets + 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]] @@ -913,9 +913,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 - updateWidgets + update .t delete 2.30 2.44 - updateWidgets + 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]] @@ -925,9 +925,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 - updateWidgets + update .t xview moveto .6 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {}} test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} { @@ -936,7 +936,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 - updateWidgets + update .t configure -wrap word list [.t bbox 2.0] [.t bbox 2.16] } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ @@ -947,7 +947,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 - updateWidgets + update .t configure -wrap char list [.t bbox 2.0] [.t bbox 2.16] } [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \ @@ -967,7 +967,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 - updateWidgets + 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}] \ @@ -984,7 +984,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 - updateWidgets + update list [winfo width .t.f] [winfo height .t.f] } [list 30 30] @@ -995,9 +995,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" } - updateWidgets + update .t delete 2.0 3.0 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 10.0} {2.0 10.0}} test textDisp-6.2 {scrolling in DisplayText, scroll down} { @@ -1006,9 +1006,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" } - updateWidgets + update .t insert 2.0 "New Line 2\n" - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { @@ -1018,10 +1018,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" } - updateWidgets + update .t insert 2.end "is so long that it wraps" .t insert 4.end "is so long that it wraps" - updateWidgets + 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} { @@ -1031,10 +1031,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" } - updateWidgets + 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" - updateWidgets + 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} { @@ -1047,9 +1047,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" } - updateWidgets + update .t delete 1.6 1.end - updateWidgets + update destroy .f2 list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}} @@ -1066,31 +1066,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" } - updateWidgets + update .t delete 1.6 1.end destroy .f2 - updateWidgets + 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 - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + 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" - updateWidgets + update set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - updateWidgets + update .t count -update -ypixels 1.0 end ; update set scrollInfo } [list 0.0 [expr {10.0/13}]] @@ -1098,12 +1098,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 - updateWidgets + update set scrollInfo unchanged .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua} { @@ -1122,9 +1122,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"} - updateWidgets + update .t delete 2.0 3.0 - updateWidgets + update list $tk_textEmbWinDisplay } {{4.0 6.0}} @@ -1139,27 +1139,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 - updateWidgets + update destroy .f2 - updateWidgets + 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 - updateWidgets + update destroy .f2 - updateWidgets + 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 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {4.0 5.0 6.0 7.0 8.0}} test textDisp-7.4 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1167,9 +1167,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 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20}} test textDisp-7.5 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1177,9 +1177,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 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 7.0 8.0}} test textDisp-7.6 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1187,9 +1187,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 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.7 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1197,9 +1197,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 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.8 {TkTextRedrawRegion} {aquaKnownBug} { @@ -1209,9 +1209,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 - updateWidgets + update destroy .f2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 eof}} .t configure -bd 0 @@ -1223,9 +1223,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" } - updateWidgets + update .t delete 2.36 2.38 - updateWidgets + 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 @@ -1235,9 +1235,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" } - updateWidgets + update .t insert 1.2 xx - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.3 {TkTextChanged} { @@ -1246,9 +1246,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" } - updateWidgets + update .t insert 2.0 xx - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.4 {TkTextChanged} { @@ -1257,9 +1257,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" } - updateWidgets + update .t delete 1.5 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.5 {TkTextChanged} { @@ -1268,9 +1268,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" } - updateWidgets + update .t delete 1.40 1.44 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.6 {TkTextChanged} { @@ -1279,9 +1279,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" } - updateWidgets + update .t delete 1.41 1.44 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.7 {TkTextChanged} { @@ -1290,9 +1290,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" } - updateWidgets + update .t delete 1.2 1.end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 9.0 10.0}} test textDisp-8.8 {TkTextChanged} { @@ -1301,9 +1301,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" } - updateWidgets + update .t delete 2.2 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.9 {TkTextChanged} { @@ -1312,9 +1312,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" } - updateWidgets + update .t delete 2.0 3.0 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 8.0} {2.0 8.0}} test textDisp-8.10 {TkTextChanged} { @@ -1322,23 +1322,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 - updateWidgets + update .t delete 2.19 - updateWidgets + 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 - updateWidgets + update set scrollInfo "" .t insert end "a\nb\nc\n" # We need to wait for our asychronous callbacks to update the # scrollbar - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update .t configure -yscrollcommand "" set scrollInfo } {0.0 0.625} @@ -1351,27 +1351,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 - updateWidgets + update .t mark set insert 8.0 ; # up one line - updateWidgets + update set res [list $tk_textRedraw] .t mark set insert 12.2 ; # in the visible text - updateWidgets + update lappend res $tk_textRedraw .t mark set insert 6.5 ; # in the hidden text - updateWidgets + update lappend res $tk_textRedraw .t mark set insert 3.5 ; # in the visible text again - updateWidgets + update lappend res $tk_textRedraw .t mark set insert 3.8 ; # within the same line - updateWidgets + 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 - updateWidgets + update .t insert 3.0 "" .t delete 1.0 2.0 update idletasks @@ -1381,9 +1381,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" - updateWidgets + update .t tag add big 2.2 2.4 - updateWidgets + 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 @@ -1392,9 +1392,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" - updateWidgets + update .t tag add big 1.2 2.4 - updateWidgets + 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 @@ -1403,22 +1403,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" - updateWidgets + update .t tag add big 2.2 2.4 - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + 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" - updateWidgets + update .t tag add big 2.2 2.20 - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.5 {TkTextRedrawTag} -setup { @@ -1426,25 +1426,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" - updateWidgets + update .t tag add big 2.2 2.end - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + update list $tk_textRelayout $tk_textRedraw } -cleanup { .t configure -height [expr {[.t cget -height]-10}] - updateWidgets + 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" - updateWidgets + update .t tag add big 2.2 3.5 - updateWidgets + update .t tag remove big 1.0 end - updateWidgets + 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} { @@ -1452,9 +1452,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 - updateWidgets + update .t tag remove big 2.19 - updateWidgets + update set tk_textRedraw } {2.0 2.20 eof} test textDisp-9.8 {TkTextRedrawTag} -body { @@ -1462,9 +1462,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 - updateWidgets + update .t tag add big 2.0 2.5 - updateWidgets + update set tk_textRedraw # glob matching is to have some tolerance on actually used font size # while still testing what we want to test @@ -1474,9 +1474,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 - updateWidgets + update .t tag add big 1.5 2.5 - updateWidgets + update set tk_textRedraw # glob matching is to have some tolerance on actually used font size # while still testing what we want to test @@ -1486,10 +1486,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 - updateWidgets + update set tk_textRedraw none .t tag add big 1.3 1.5 - updateWidgets + update set tk_textRedraw } none test textDisp-9.11 {TkTextRedrawTag} { @@ -1497,9 +1497,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 - updateWidgets + update .t tag add big 1.0 2.0 - updateWidgets + update set tk_textRedraw } {} test textDisp-9.12 {TkTextRedrawTag} { @@ -1510,9 +1510,9 @@ test textDisp-9.12 {TkTextRedrawTag} { } .t tag configure hidden -elide true .t tag add hidden 2.6 3.6 - updateWidgets + update .t tag add hidden 3.11 4.6 - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {2.0 {2.0 eof}} test textDisp-9.13 {TkTextRedrawTag} { @@ -1525,9 +1525,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 - updateWidgets + update .t tag configure hidden -elide false - updateWidgets + update list $tk_textRelayout $tk_textRedraw } {{2.0 6.0 7.0} {2.0 6.0 7.0}} test textDisp-9.14 {TkTextRedrawTag} { @@ -1537,7 +1537,7 @@ test textDisp-9.14 {TkTextRedrawTag} { } .tnocrash tag configure mytag1 -relief raised .tnocrash tag configure mytag2 -relief solid - updateWidgets + update proc doit {} { .tnocrash tag add mytag1 4.0 5.0 .tnocrash tag add mytag2 4.0 5.0 @@ -1559,9 +1559,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" - updateWidgets + update .t configure -bg black - updateWidgets + 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] @@ -1575,7 +1575,7 @@ test textDisp-10.2 {TkTextRelayoutWindow} { .top.t see insert tkwait visibility .top.t place .top.t -width 150 -height 100 - updateWidgets + update .top.t index @0,0 } {1.0} catch {destroy .top} @@ -1585,96 +1585,96 @@ catch {destroy .top} for {set i 2} {$i <= 200} {incr i} { .t insert end "\nLine $i" } -updateWidgets +update test textDisp-11.1 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t index @0,0 } {30.0} test textDisp-11.2 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t yview 32.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.3 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t yview 28.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.4 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update .t yview 31.4 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {31.0 40.0} test textDisp-11.5 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 31.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {30.0 {}} test textDisp-11.6 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 28.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.7 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 26.0 - updateWidgets + 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 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 41.0 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.9 {TkTextSetYView} { .t yview 30.0 - updateWidgets + update set tk_textRedraw {} .t yview -pickplace 43.0 - updateWidgets + 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 - updateWidgets + update set tk_textRedraw {} .t yview 10000.0 - updateWidgets + 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 - updateWidgets + update set tk_textRedraw {} .t yview 197.0 - updateWidgets + 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 - updateWidgets + update set tk_textRedraw {} .t see 10.30 - updateWidgets + update list [.t index @0,0] $tk_textRedraw } {2.0 10.20} .t delete 10.0 11.0 @@ -1688,15 +1688,15 @@ test textDisp-11.13 {TkTestSetYView, partially visible last line} { for {set i 2} {$i <= 100} {incr i} { .top.t insert end "\nLine $i" } - updateWidgets + update scan [wm geometry .top] "%dx%d" w2 h2 wm geometry .top ${w2}x[expr {$h2-2}] - updateWidgets + update .top.t yview 1.0 - updateWidgets + update set tk_textRedraw {} .top.t see 5.0 - updateWidgets + 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 @@ -1710,29 +1710,29 @@ pack .top.t for {set i 2} {$i <= 20} {incr i} { .top.t insert end "\nLine $i" } -updateWidgets +update test textDisp-11.14 {TkTextSetYView, only a few lines visible} { .top.t yview 5.0 - updateWidgets + 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 - updateWidgets + 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 - updateWidgets + 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 - updateWidgets + update .top.t see 4.0 .top.t index @0,0 # The index 2.0 should be just visible by a couple of pixels @@ -1747,7 +1747,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 - updateWidgets + update .top.t see "8.0 lineend" # The index "8.0 lineend" is on screen despite elided -> no scroll .top.t index @0,0 @@ -1767,19 +1767,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 - updateWidgets + update .top.t see 21.0 - updateWidgets + update set ind1 [.top.t index @0,0] .top.t see end - updateWidgets + update .top.t see 17.0 - updateWidgets + update set ind2 [.top.t index @0,0] .top.t see end - updateWidgets + update .top.t see 15.0 - updateWidgets + update set ind3 [.top.t index @0,0] list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}] } {1 1} @@ -1802,7 +1802,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}] - updateWidgets + update .top.t see 1.0 .top.t index @0,[expr {$lineheight - 2}] } {1.0} @@ -1814,9 +1814,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} - updateWidgets + update .top.p yview moveto 0 - updateWidgets + update set res [.top.p get @0,0 "@0,0 lineend"] destroy .top.p set res @@ -1827,38 +1827,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 - updateWidgets + update .t yview -pickplace 52.0 - updateWidgets + update .t index @0,0 } {49.0} test textDisp-12.2 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 53.0 - updateWidgets + update .t index @0,0 } {50.0} test textDisp-12.3 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 50.10 - updateWidgets + update .t index @0,0 } {45.0} .t configure -wrap none test textDisp-12.4 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 53.0 - updateWidgets + update .t index @0,0 } {48.0} test textDisp-12.5 {MeasureUp} { .t yview 100.0 - updateWidgets + update .t yview -pickplace 50.10 - updateWidgets + update .t index @0,0 } {45.0} @@ -1881,7 +1881,7 @@ test textDisp-13.3 {TkTextSeeCmd procedure} { test textDisp-13.4 {TkTextSeeCmd procedure} { .t xview moveto 0 .t yview moveto 0 - updateWidgets + update .t see 4.2 .t index @0,0 } {1.0} @@ -1889,7 +1889,7 @@ test textDisp-13.5 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - updateWidgets + update .t see 12.1 .t index @0,0 } {3.0} @@ -1897,7 +1897,7 @@ test textDisp-13.6 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - updateWidgets + update .t see 30.50 set x [.t index @0,0] .t configure -wrap none @@ -1908,7 +1908,7 @@ test textDisp-13.7 {TkTextSeeCmd procedure} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.40 - updateWidgets + update .t see 30.50 .t yview 25.0 .t see 30.50 @@ -1928,7 +1928,7 @@ test textDisp-13.8 {TkTextSeeCmd procedure} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - updateWidgets + update .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1952,7 +1952,7 @@ test textDisp-13.9 {TkTextSeeCmd procedure} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - updateWidgets + update .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1991,13 +1991,13 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} { .top2.t2 insert end [string repeat "Line $i: éèà çù" 5]\n } wm geometry .top2 300x200+0+0 - updateWidgets + update .top2.t2 see "1.0 lineend" - updateWidgets + update set ref [.top2.t2 index @0,0] .top2.t2 insert "1.0 lineend" ç .top2.t2 see "1.0 lineend" - updateWidgets + update set new [.top2.t2 index @0,0] set res [.top2.t2 compare $ref == $new] destroy .top2 @@ -2008,7 +2008,7 @@ wm geom . {} .t configure -wrap none test textDisp-14.1 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateWidgets + update .t insert end xxxxxxxxx\n .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" @@ -2018,7 +2018,7 @@ test textDisp-14.1 {TkTextXviewCmd procedure} { .t configure -wrap char test textDisp-14.2 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateWidgets + update .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -2027,7 +2027,7 @@ test textDisp-14.2 {TkTextXviewCmd procedure} { .t configure -wrap none test textDisp-14.3 {TkTextXviewCmd procedure} { .t delete 1.0 end - updateWidgets + update .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -2120,43 +2120,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 - updateWidgets + update .t yview scroll -3 units .t index @0,0 } {42.0} test textDisp-15.2 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - updateWidgets + update .t yview scroll -2 units .t index @0,0 } {50.20} test textDisp-15.3 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - updateWidgets + update .t yview scroll -4 units .t index @0,0 } {49.0} test textDisp-15.4 {ScrollByLines procedure, scrolling backwards} { .t yview 50.20 - updateWidgets + update .t yview scroll -2 units .t index @0,0 } {49.0} test textDisp-15.5 {ScrollByLines procedure, scrolling backwards} { .t yview 50.40 - updateWidgets + update .t yview scroll -2 units .t index @0,0 } {50.0} test textDisp-15.6 {ScrollByLines procedure, scrolling backwards} { .t yview 3.2 - updateWidgets + update .t yview scroll -5 units .t index @0,0 } {1.0} test textDisp-15.7 {ScrollByLines procedure, scrolling forwards} { .t yview 48.0 - updateWidgets + update .t yview scroll 4 units .t index @0,0 } {50.40} @@ -2182,7 +2182,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" } - updateWidgets + 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 @@ -2202,7 +2202,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.} -updateWidgets +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 @@ -2230,7 +2230,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 - updateWidgets + update .t yview 98 .t index @0,0 } {99.0} @@ -2314,7 +2314,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 - updateWidgets + update .top1.t insert end "1\n2\n3\n4\n5\n6" .top1.t yview moveto 0.3333 set result [.top1.t yview] @@ -2335,7 +2335,7 @@ test textDisp-16.21.2 {TkTextYviewCmd procedure, "scroll" option} { } {1 {expected integer but got "badInt"}} test textDisp-16.22 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 - updateWidgets + update .t yview scroll -1 pages .t index @0,0 } {42.0} @@ -2344,13 +2344,13 @@ test textDisp-16.22.1 {TkTextYviewCmd procedure, "scroll" option, back pages} { } {1 {ambiguous argument "p": must be units, pages, or pixels}} test textDisp-16.23 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 - updateWidgets + 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 - updateWidgets + update .t yview scroll -3 pa .t index @0,0 } {1.0} @@ -2361,32 +2361,32 @@ test textDisp-16.25 {TkTextYviewCmd procedure, "scroll" option, back pages} -set pack .f2 -side top } -body { .t configure -height 1 - updateWidgets + update .t yview 50.0 - updateWidgets + update .t yview scroll -1 pages set x [.t index @0,0] .t configure -height 10 - updateWidgets + update set x } -cleanup { destroy .f2 } -result {49.0} test textDisp-16.26 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t yview 50.0 - updateWidgets + 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 - updateWidgets + 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 - updateWidgets + 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 @@ -2397,24 +2397,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 - updateWidgets + update .t yview 50.0 - updateWidgets + update .t yview scroll 1 pages set x [.t index @0,0] .t configure -height 10 - updateWidgets + update set x } {51.0} test textDisp-16.30 {TkTextYviewCmd procedure, "scroll units" option} { .t yview 45.0 - updateWidgets + 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 - updateWidgets + update .t yview scroll 4 units .t index @0,0 } {151.40} @@ -2519,7 +2519,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 - updateWidgets + update .t index @0,0 } {5.0} test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { @@ -2533,7 +2533,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 - updateWidgets + update .t index @0,0 } {5.0} test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} { @@ -2544,9 +2544,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 - updateWidgets + update .t see [expr {5 + [winfo height .t] / $fixedHeight + 1}].0 - updateWidgets + update .t index @0,0 } {2.0} @@ -2574,83 +2574,83 @@ test textDisp-17.5 {TkTextScanCmd procedure} { test textDisp-17.6 {TkTextScanCmd procedure} { .t yview 1.0 .t xview moveto 0 - updateWidgets + update set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]] .t scan mark 40 60 .t scan dragto 35 55 - updateWidgets + update lequal [.t index @0,0] $expected } {1} test textDisp-17.7 {TkTextScanCmd procedure} { # 1st result .t yview 1.0 .t xview moveto 0 - updateWidgets + update set expected [.t index @[expr {[bo]+20*$fixedWidth-50}],[expr {[bo]+9*$fixedHeight-50}]] .t yview 10.0 .t xview scroll 20 units - updateWidgets + update .t scan mark -10 60 .t scan dragto -5 65 - updateWidgets + update set x [.t index @0,0] # 2nd result .t yview 1.0 .t xview moveto 0 - updateWidgets + 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 - updateWidgets + update .t scan mark -10 60 .t scan dragto -5 65 - updateWidgets + update .t scan dragto 0 72 - updateWidgets + update lequal [list $x [.t index @0,0]] $expected } {1} test textDisp-17.8 {TkTextScanCmd procedure} { .t yview 1.0 .t xview moveto 0 - updateWidgets + update set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]] .t scan mark 0 60 .t scan dragto 30 100 - updateWidgets + update .t scan dragto 25 95 - updateWidgets + update lequal [.t index @0,0] $expected } {1} test textDisp-17.9 {TkTextScanCmd procedure} { .t yview end .t xview moveto 0 - updateWidgets + update # this brings us at lower right corner of the text .t xview scroll 100 units - updateWidgets + update # this does not trigger any scroll, we're already at the corner .t scan mark 90 60 .t scan dragto 10 0 - updateWidgets + 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 - updateWidgets + update lequal [.t index @0,0] $expected } {1} .t configure -wrap word test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} { .t yview 10.0 - updateWidgets + 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 - updateWidgets + 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 - updateWidgets + update lequal [list $x [.t index @0,0]] $expected } {1} .t configure -xscrollcommand scroll -yscrollcommand {} @@ -2661,7 +2661,7 @@ test textDisp-18.1 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-18.2 {GetXView procedure} { @@ -2670,13 +2670,13 @@ test textDisp-18.2 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-18.3 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-18.4 {GetXView procedure} { @@ -2685,7 +2685,7 @@ test textDisp-18.4 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxx\n .t insert end xxxxxxxxxxxxxxxxx - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-18.5 {GetXView procedure} { @@ -2695,7 +2695,7 @@ test textDisp-18.5 {GetXView procedure} { .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx .t xview scroll 31 units - updateWidgets + update set scrollInfo } [list [expr {31.0/55}] [expr {51.0/55}]] test textDisp-18.6 {GetXView procedure} { @@ -2706,27 +2706,27 @@ test textDisp-18.6 {GetXView procedure} { .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" .t xview moveto 0 .t xview scroll 31 units - updateWidgets + update set x {} lappend x $scrollInfo .t configure -wrap char - updateWidgets + update lappend x $scrollInfo .t configure -wrap word - updateWidgets + update lappend x $scrollInfo .t configure -wrap none - updateWidgets + 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 - updateWidgets + update set scrollInfo unchanged .t insert end xxxxxx\n .t insert end xxx - updateWidgets + update set scrollInfo } {unchanged} test textDisp-18.8 {GetXView procedure} { @@ -2740,10 +2740,10 @@ test textDisp-18.8 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n - updateWidgets + update .t delete 1.0 end .t configure -xscrollcommand scrollError - updateWidgets + update set x } {{scrolling error} {scrolling error while executing @@ -2759,37 +2759,37 @@ catch {rename bogus {}} test textDisp-19.1 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateWidgets + update set scrollInfo } {0.0 1.0} test textDisp-19.2 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateWidgets + update set scrollInfo "unchanged" .t insert 1.0 "Line1\nLine2" - updateWidgets + update set scrollInfo } {unchanged} test textDisp-19.3 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - updateWidgets + update set scrollInfo "unchanged" .t insert 1.0 "Line 1\nLine 2 is so long that it wraps around\nLine 3" - updateWidgets + 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" - updateWidgets + update set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - updateWidgets + update set scrollInfo } [list 0.0 [expr {70.0/91}]] test textDisp-19.5 {GetYView procedure} { @@ -2800,7 +2800,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" - updateWidgets + update set x $scrollInfo } {0.0 0.625} test textDisp-19.6 {GetYView procedure} { @@ -2812,7 +2812,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 - updateWidgets + update set x $scrollInfo } {0.375 1.0} test textDisp-19.7 {GetYView procedure} { @@ -2824,7 +2824,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 - updateWidgets + update set x $scrollInfo } {0.125 0.75} test textDisp-19.8 {GetYView procedure} { @@ -2836,7 +2836,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 - updateWidgets + update .t count -update -ypixels 1.0 end set x $scrollInfo } {0.0625 0.6875} @@ -2848,7 +2848,7 @@ test textDisp-19.9 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 3.0 - updateWidgets + update set scrollInfo } [list [expr {4.0/30}] 0.8] test textDisp-19.10 {GetYView procedure} { @@ -2859,7 +2859,7 @@ test textDisp-19.10 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 11.0 - updateWidgets + update set scrollInfo } [list [expr {1.0/3}] 1.0] test textDisp-19.10.1 {Widget manipulation causes height miscount} { @@ -2870,7 +2870,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} { .t insert end "\nLine $i" } .t yview 11.0 - updateWidgets + update .t configure -wrap word .t delete 1.0 end .t insert 1.0 "Line 1" @@ -2880,7 +2880,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 - updateWidgets + update .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -2894,7 +2894,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 - updateWidgets + update .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -3032,10 +3032,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. - updateWidgets + update scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - updateWidgets + 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} { @@ -3046,10 +3046,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. - updateWidgets + update scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - updateWidgets + update .top.t yview } [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]] catch {destroy .top} @@ -3063,14 +3063,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. - updateWidgets + update .t count -update -ypixels 1.0 end delay set scrollInfo "unchanged" .t mark set insert 3.0 .t tag configure x -background red .t tag add x 1.0 5.0 - updateWidgets + update .t tag delete x set scrollInfo } {unchanged} @@ -3083,14 +3083,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." - updateWidgets + update .t configure -yscrollcommand scrollError proc bgerror args { global x errorInfo errorCode set x [list $args $errorInfo $errorCode] } .t delete 1.0 end - updateWidgets + update rename bgerror {} .t configure -yscrollcommand scroll set x @@ -3112,9 +3112,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. - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update set res [list \ [.t count -ypixels 1.0 end] \ [.t count -update -ypixels 1.0 end] \ @@ -3137,9 +3137,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 - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update set res [list \ [.t count -ypixels 1.0 6.0] \ [.t count -ypixels 2.0 7.5] \ @@ -3173,12 +3173,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 - updateWidgets + update .t count -update -ypixels 1.0 end - updateWidgets + update set res [.t count -ypixels 5.0 25.0] .t yview scroll [expr {- 15 * $fixedHeight}] pixels - updateWidgets + 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} { @@ -3191,7 +3191,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 - updateWidgets + 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 @@ -3300,7 +3300,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" -updateWidgets +update .t tag add x 50.1 test textDisp-22.1 {TkTextCharBbox} { .t config -wrap word @@ -3321,58 +3321,58 @@ test textDisp-22.2 {TkTextCharBbox} { [list [xchar 0] [yline 10] $fixedWidth $fixedHeight]] test textDisp-22.3 {TkTextCharBbox, cut-off lines} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - updateWidgets + 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 . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - updateWidgets + 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 . {} - updateWidgets + update .t config -wrap none .t yview 10.0 wm geom . [expr {$width-(20-7)*$fixedWidth}]x$height - updateWidgets + update .t bbox 15.6 } [list [xchar 6] [yline 6] $fixedWidth $fixedHeight] test textDisp-22.6 {TkTextCharBbox, line visible but not char} { wm geometry . {} - updateWidgets + 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}] - updateWidgets + 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 . {} -updateWidgets +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 - updateWidgets + 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]] @@ -3405,7 +3405,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 - updateWidgets + 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] \ @@ -3424,7 +3424,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 - updateWidgets + 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]}] \ @@ -3446,7 +3446,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 - updateWidgets + 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]}] @@ -3460,7 +3460,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" -updateWidgets +update test textDisp-23.1 {TkTextDLineInfo} { .t config -wrap word .t yview 48.0 @@ -3473,44 +3473,44 @@ test textDisp-23.1 {TkTextDLineInfo} { .t config -bd 4 test textDisp-23.2 {TkTextDLineInfo} { .t config -wrap word - updateWidgets + 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 - updateWidgets + 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 . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - updateWidgets + 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 . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - updateWidgets + 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 . {} -updateWidgets +update test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} { .t config -wrap none .t delete 1.0 end @@ -3518,7 +3518,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 - updateWidgets + 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] \ @@ -3549,7 +3549,7 @@ test textDisp-24.1 {TkTextCharLayoutProc} { [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]] test textDisp-24.2 {TkTextCharLayoutProc} { wm geometry . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end @@ -3560,20 +3560,20 @@ test textDisp-24.2 {TkTextCharLayoutProc} { incr wi -$fixedWidth } wm geom . [expr {$wi+1}]x$height - updateWidgets + 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 . {} - updateWidgets + 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 - updateWidgets + 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 @@ -3583,7 +3583,7 @@ test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} { .t delete 1.0 end .t insert 1.0 01234567890123456789\n012345678901234567890 wm geom . {} - updateWidgets + 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] \ @@ -3596,7 +3596,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 - updateWidgets + 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] \ @@ -3606,13 +3606,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 . {} - updateWidgets + 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 . {} - updateWidgets + update scan [wm geom .] %dx%d oriWidth oriHeight .t configure -wrap char .t delete 1.0 end @@ -3623,46 +3623,46 @@ test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} { incr wi -$fixedWidth } wm geom . [expr {$wi+1}]x$height - updateWidgets + 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 . {} - updateWidgets + 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 - updateWidgets + 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 . {} - updateWidgets + 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 - updateWidgets + 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 . {} - updateWidgets + 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 - updateWidgets + 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 @@ -3674,7 +3674,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 - updateWidgets + 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] @@ -3683,7 +3683,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 . {} -updateWidgets +update test textDisp-24.12 {TkTextCharLayoutProc, tab causes wrap} { .t configure -wrap char .t delete 1.0 end @@ -3699,31 +3699,31 @@ test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . {} - updateWidgets + 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 . {} - updateWidgets + 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 - updateWidgets + 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 . {} - updateWidgets + 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 - updateWidgets + 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 @@ -3738,7 +3738,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 - updateWidgets + 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] \ @@ -3751,7 +3751,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 . {} - updateWidgets + 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]] @@ -3760,7 +3760,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 . {} - updateWidgets + 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] \ @@ -3771,7 +3771,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 . {} - updateWidgets + 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] \ @@ -3796,7 +3796,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 -updateWidgets +update test textDisp-24.21 {TkTextCharLayoutProc, word breaks} { .t configure -wrap word .t delete 1.0 end @@ -3826,7 +3826,7 @@ test textDisp-24.23 {TkTextCharLayoutProc, word breaks} { } [list [xchar 0] [yline 3] 50 20] catch {destroy .t.f} .t configure -width 20 -updateWidgets +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. @@ -3843,7 +3843,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup { pack .tt } -body { .tt insert end \t9\n\t99\n\t999 - updateWidgets + 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]] @@ -3854,7 +3854,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup { .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 \ -tabs 100 -updateWidgets +update test textDisp-25.1 {CharBboxProc procedure, check tab width} { .t delete 1.0 end .t insert 1.0 abc\td\tfgh @@ -3865,7 +3865,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 {} -updateWidgets +update test textDisp-26.1 {AdjustForTab procedure, no tabs} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -3992,7 +3992,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 - updateWidgets + update lindex [.t bbox 1.5] 0 } {120} test textDisp-26.13 {AdjustForTab procedure, not enough space} { @@ -4050,7 +4050,7 @@ test textDisp-26.14.2 {AdjustForTab procedure, not enough space} { .t configure -width 20 -bd 2 -highlightthickness 2 -relief sunken -tabs {} \ -wrap char -updateWidgets +update test textDisp-27.1 {SizeOfTab procedure, old-style tabs} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -4144,7 +4144,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)}] - updateWidgets + 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 @@ -4165,7 +4165,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)}] - updateWidgets + update set res [.t bbox 2.23] .t configure -tabstyle tabular lset res 0 [expr {[lindex $res 0] - $tab}] @@ -4179,17 +4179,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] - updateWidgets + update set res [.t bbox 1.20] # Now, Tk's interpolated tabs should be the same as # non-interpolated. .t configure -tabs $precisetab - updateWidgets + update expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]} } {0} .t configure -wrap char -tabs {} -width 20 -updateWidgets +update test textDisp-27.8 {SizeOfTab procedure, right alignment} { .t delete 1.0 end .t insert 1.0 a\t\txyzzyabc @@ -4238,11 +4238,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 - updateWidgets + update .t2.t configure -yscrollcommand bizarre_scroll .t2.t yview 100.0 set result [.t2.t index @0,0] - updateWidgets + update lappend result [.t2.t index @0,0] } -cleanup { destroy .t2 @@ -4261,7 +4261,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 - updateWidgets + 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]] @@ -4282,9 +4282,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 - updateWidgets + update .t2.t xview scroll 1 unit - updateWidgets + 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]] @@ -4304,9 +4304,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] - updateWidgets + update .t2.t xview scroll 5 unit - updateWidgets + update .t2.t xview } -cleanup { destroy .t2 @@ -4324,9 +4324,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 - updateWidgets + update .t2.t xview scroll 2 unit - updateWidgets + 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] \ {}] @@ -4347,9 +4347,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 - updateWidgets + update .t2.t xview scroll 7 pixels - updateWidgets + 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]] @@ -4370,9 +4370,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 - updateWidgets + update .t2.t xview scroll 17 pixels - updateWidgets + 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] \ {}] @@ -4395,7 +4395,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 - updateWidgets + update set xv [.t2.t xview] set xd [expr {[lindex $xv 1] - [lindex $xv 0]}] .t2.t xview moveto [expr {1.0-$xd}] @@ -4423,9 +4423,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 - updateWidgets + update .t2.t xview scroll 200 units - updateWidgets + 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] \ {}] @@ -4444,7 +4444,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 - updateWidgets + update .t2.t count -update -displaylines 1.0 end } -cleanup { destroy .t2 @@ -4459,7 +4459,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 - updateWidgets + update .t2.t count -update -displaylines 1.0 end } -cleanup { destroy .t2 @@ -4467,7 +4467,7 @@ test textDisp-30.2 {elided text joining multiple logical lines} -setup { catch {destroy .t2} .t configure -height 1 -updateWidgets +update test textDisp-31.1 {line embedded window height update} { set res {} @@ -4485,7 +4485,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 - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -4509,7 +4509,7 @@ test textDisp-31.3 {line update index shifting} { # have been performed. set res {} .t.f configure -height 100 - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -4533,7 +4533,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 - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 lappend res [.t count -ypixels 1.0 end] @@ -4545,7 +4545,7 @@ test textDisp-31.4 {line embedded image height update} { test textDisp-31.5 {line update index shifting} { set res {} textest configure -height 100 - updateWidgets + update lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 .t insert 1.0 "abc\n" @@ -4620,19 +4620,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 - updateWidgets + update destroy .tt } {} test textDisp-32.1 {everything elided} { # Must not crash pack [text .tt] - updateWidgets + update .tt insert 0.0 HELLO - updateWidgets + update .tt tag configure HIDE -elide 1 - updateWidgets + update .tt tag add HIDE 0.0 end - updateWidgets + update destroy .tt } {} test textDisp-32.2 {elide and tags} { @@ -4643,11 +4643,11 @@ test textDisp-32.2 {elide and tags} { {testtag1 testtag3} \ {[this bit here uses tags 2 and 3]} \ {testtag2 testtag3} - updateWidgets + update # indent left margin of tag 1 by 20 pixels # text should be indented .tt tag configure testtag1 -lmargin1 20 - updateWidgets + update #1 set res {} lappend res [list [.tt index "1.0 + 0 displaychars"] \ @@ -4656,7 +4656,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 - updateWidgets + update #2 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4667,7 +4667,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 - updateWidgets + update #3 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4676,7 +4676,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 - updateWidgets + update #4 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4689,7 +4689,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 - updateWidgets + update #5 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4698,7 +4698,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 - updateWidgets + update #6 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4736,7 +4736,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup { .tt insert end ":)" emoticon .tt image create end -image $img pack .tt - updateWidgets + update } -cleanup { image delete $img destroy .tt @@ -4758,20 +4758,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] - updateWidgets + update .tt insert 1.0 [string repeat "more wrap + " 300] - updateWidgets + 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] - updateWidgets + update .tt insert 1.0 [string repeat "more wrap + " 300] - updateWidgets + update .tt yview "1.0 +1 displaylines" - updateWidgets + update if {[lindex [.tt yview] 0] > 0.1} { set result "window should be scrolled to the top" } else { @@ -4782,7 +4782,7 @@ test textDisp-33.2 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] .tt debug 1 - updateWidgets + update set tk_textHeightCalc "" set timer [after 200 lappend tk_textHeightCalc "Timed out"] .tt insert 1.0 [string repeat "more wrap + " 1] @@ -4795,7 +4795,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] - updateWidgets + update .tt sync # Each line should have been recalculated just once expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]} @@ -4804,7 +4804,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] - updateWidgets + update set idx [.tt index "1.0 + 1 displaylines"] .tt yview $idx if {[lindex [.tt yview] 0] > 0.1} { @@ -4825,7 +4825,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 - updateWidgets + update set bb {} for {set i 0} {$i < 12} {incr i 4} { lappend bb [lindex [.tt bbox 1.$i] 0] @@ -4851,7 +4851,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 - updateWidgets + update .t1 sync set negative 0 bind .t1 <<WidgetViewSync>> { if {%d < 0} {set negative 1} } @@ -4861,7 +4861,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" - updateWidgets + update .t1 sync set negative } -cleanup { @@ -4899,7 +4899,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 - updateWidgets + update # wish now panics: "CalculateDisplayLineHeight called with bad indexPtr" .t1 yview scroll -1 pixels } -cleanup { |