diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-10 07:32:47 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-10 07:32:47 (GMT) |
commit | df640a1dfa81b087de3bc53f2b4c4b2388d3d8da (patch) | |
tree | 44ccc27b6ee7aa6b997efba804f5b0a3ad7f838d /tests | |
parent | 52867011954887f3bde7579ee25de18530eaa817 (diff) | |
download | tk-df640a1dfa81b087de3bc53f2b4c4b2388d3d8da.zip tk-df640a1dfa81b087de3bc53f2b4c4b2388d3d8da.tar.gz tk-df640a1dfa81b087de3bc53f2b4c4b2388d3d8da.tar.bz2 |
Cherry-pick test-case changes from catalina_more_tests branch. They appear to work fine on other platforms, so they deserve more exposal separate from the Catalina-specific changes.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/canvImg.test | 24 | ||||
-rw-r--r-- | tests/entry.test | 38 | ||||
-rw-r--r-- | tests/event.test | 2 | ||||
-rw-r--r-- | tests/image.test | 19 | ||||
-rw-r--r-- | tests/listbox.test | 40 | ||||
-rw-r--r-- | tests/scale.test | 16 | ||||
-rw-r--r-- | tests/spinbox.test | 38 | ||||
-rw-r--r-- | tests/textDisp.test | 780 | ||||
-rw-r--r-- | tests/textWind.test | 4 |
9 files changed, 525 insertions, 436 deletions
diff --git a/tests/canvImg.test b/tests/canvImg.test index 36e937d..51c8d43 100644 --- a/tests/canvImg.test +++ b/tests/canvImg.test @@ -737,12 +737,14 @@ test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup { .c delete all update } -body { - image create test foo -variable x + image create test foo -variable x .c create image 50 100 -image foo -tags image -anchor nw - update + update idletasks set x {} foo changed 2 4 6 8 30 15 - update + # macOS Catalina needs a delay here. + after 20 + update idletasks return $x } -cleanup { .c delete all @@ -753,12 +755,14 @@ test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup { .c delete all update } -body { - image create test foo -variable x + image create test foo -variable x .c create image 50 100 -image foo -tags image -anchor nw - update + update idletasks set x {} foo changed 2 4 6 8 40 50 - update + # macOS Catalina needs a delay here. + after 20 + update idletasks return $x } -cleanup { .c delete all @@ -771,7 +775,7 @@ test canvImg-11.2 {ImageChangedProc procedure} -constraints { } -body { image create test foo -variable x .c create image 50 100 -image foo -tags image -anchor center - update + update idletasks set x {} foo changed 0 0 0 0 40 50 .c bbox image @@ -798,10 +802,12 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints { .c create image 50 100 -image foo -tags image -anchor nw .c create image 70 110 -image foo2 -anchor nw - update + update idletasks set y {} image create test foo -variable x - update + # macOS Catalina needs a delay here. + after 20 + update idletasks return $y } -cleanup { .c delete all diff --git a/tests/entry.test b/tests/entry.test index 67f8374..3c80e07 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1671,11 +1671,13 @@ test entry-5.7 {ConfigureEntry procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo .e configure -width 5 format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.000000 0.363636} @@ -1916,10 +1918,12 @@ test entry-7.1 {InsertChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 2 XXX - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abXXXcde abXXXcde {0.000000 1.000000}} test entry-7.2 {InsertChars procedure} -setup { @@ -1931,10 +1935,12 @@ test entry-7.2 {InsertChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 500 XXX - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abcdeXXX abcdeXXX {0.000000 1.000000}} test entry-7.3 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -2063,10 +2069,12 @@ test entry-8.1 {DeleteChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 2 4 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abe abe {0.000000 1.000000}} test entry-8.2 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2077,10 +2085,12 @@ test entry-8.2 {DeleteChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete -2 2 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {cde cde {0.000000 1.000000}} test entry-8.3 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2091,10 +2101,12 @@ test entry-8.3 {DeleteChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 3 1000 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abc abc {0.000000 1.000000}} test entry-8.4 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -2927,30 +2939,36 @@ test entry-17.1 {EntryUpdateScrollbar procedure} -body { pack .e .e delete 0 end .e insert 0 123 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.000000 1.000000} test entry-17.2 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e .e insert 0 0123456789abcdef .e xview 3 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.187500 0.812500} test entry-17.3 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e .e insert 0 abcdefghijklmnopqrs .e xview 6 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.315789 0.842105} test entry-17.4 {EntryUpdateScrollbar procedure} -setup { proc bgerror msg { @@ -2960,7 +2978,7 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup { } -body { entry .e -width 5 -xscrollcommand thisisnotacommand pack .e - update + vwait x list $x $errorInfo } -cleanup { destroy .e diff --git a/tests/event.test b/tests/event.test index 39beab4..a95815e 100644 --- a/tests/event.test +++ b/tests/event.test @@ -245,6 +245,8 @@ test event-2.2(keypress) {type into entry widget and then delete some text} -set set e [entry $t.e] pack $e tkwait visibility $e + # Avoid a hang when macOS puts the mouse pointer on the green button + wm geometry .t +200+100 _keypress_string $e MELLO _keypress $e BackSpace _keypress $e BackSpace diff --git a/tests/image.test b/tests/image.test index 5842ce3..70c3f72 100644 --- a/tests/image.test +++ b/tests/image.test @@ -88,10 +88,12 @@ test image-1.8 {Tk_ImageCmd procedure, "create" option} -constraints { .c create image 100 50 -image myimage .c create image 100 150 -image myimage image delete myimage - update + update idletasks set x {} image create test myimage -variable x - update + # macOS Catalina needs a delay here. + after 20 + update idletasks return $x } -cleanup { .c delete all @@ -398,10 +400,13 @@ test image-9.2 {Tk_ImageChanged procedure} -constraints testImageType -setup { image create test foo -variable x .c create image 50 50 -image foo .c create image 90 100 -image foo - update + update idletasks set x {} foo changed 5 6 7 8 30 15 - update + image create test myimage -variable x + # macOS Catalina needs a delay here. + after 20 + update idletasks return $x } -cleanup { .c delete all @@ -437,11 +442,13 @@ test image-11.1 {Tk_FreeImage procedure} -constraints testImageType -setup { .c create image 50 50 -image foo -tags i1 .c create image 90 100 -image foo -tags i2 pack forget .c - update + update idletasks set x {} .c delete i1 pack .c - update + update idletasks + # macOS Catalina needs a delay here. + after 20 list [imageNames] $x } -cleanup { .c delete all diff --git a/tests/listbox.test b/tests/listbox.test index 68cb5d8..44b7f83 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -2209,12 +2209,13 @@ test listbox-11.5 {ChangeListboxView procedure} -setup { } -body { listbox .l -height 5 -yscrollcommand "record y" pack .l + update idletasks .l insert 0 a b c d e f g h i j .l yview 3 - update + update idletasks set log {} .l yview 3 - update + update idletasks list [format {%.6g %.6g} {*}[.l yview]] $log } -cleanup { destroy .l @@ -2662,10 +2663,10 @@ test listbox-21.9 {ListboxListVarProc, test hscrollbar after listvar mod} -setup destroy .l } -body { catch {unset x} - set log {} listbox .l -font $fixed -width 10 -xscrollcommand "record x" -listvar x + set log {} pack .l - update + vwait log lappend x "0000000000" update lappend x "00000000000000000000" @@ -2678,16 +2679,16 @@ test listbox-21.10 {ListboxListVarProc, test hscrollbar after listvar mod} -setu destroy .l } -body { catch {unset x} - set log {} listbox .l -font $fixed -width 10 -xscrollcommand "record x" -listvar x + set log {} pack .l - update + vwait log lappend x "0000000000" - update + update idletasks lappend x "00000000000000000000" - update + update idletasks set x [list "0000000000"] - update + update idletasks set log } -cleanup { destroy .l @@ -2755,12 +2756,14 @@ test listbox-21.15 {ListboxListVarProc, update vertical scrollbar} -setup { destroy .l } -body { catch {unset x} + listbox .l -font $fixed -height 3 -yscrollcommand "record y" -listvar x + update idletasks set log {} - listbox .l -listvar x -yscrollcommand "record y" -font fixed -height 3 pack .l - update + vwait log + update idletasks lappend x a b c d e f - update + vwait log set log } -cleanup { destroy .l @@ -2771,16 +2774,15 @@ test listbox-21.16 {ListboxListVarProc, update vertical scrollbar} -setup { catch {unset x} listbox .l -listvar x -height 3 pack .l - update set x [list 0 1 2 3 4 5] .l yview scroll 3 units - update + update idletasks set result {} lappend result [format {%.6g %.6g} {*}[.l yview]] set x [lreplace $x 3 3] set x [lreplace $x 3 3] set x [lreplace $x 3 3] - update + update idletasks lappend result [format {%.6g %.6g} {*}[.l yview]] set result } -cleanup { @@ -2792,14 +2794,14 @@ test listbox-21.16 {ListboxListVarProc, update vertical scrollbar} -setup { test listbox-22.1 {UpdateHScrollbar} -setup { destroy .l } -body { - set log {} listbox .l -font $fixed -width 10 -xscrollcommand "record x" + set log {} pack .l - update + vwait log .l insert end "0000000000" - update + update idletasks .l insert end "00000000000000000000" - update + vwait log set log } -cleanup { destroy .l diff --git a/tests/scale.test b/tests/scale.test index 75293aa..38c3e9a 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -1478,10 +1478,12 @@ test scale-20.4 {Bug [2262543fff] - Scale widget unexpectedly fires command call scale .s -from 1 -to 50 -command {set commandedVar} .s set 10 pack .s - update ; # -command callback shall fire + set timeout [after 500 {set $commandedVar "timeout"}] + vwait commandedVar ; # -command callback shall fire set res [list [.s get] $commandedVar] } -cleanup { destroy .s + after cancel $timeout } -result {10 10} test scale-20.5 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 5} -setup { catch {destroy .s} @@ -1506,10 +1508,12 @@ test scale-20.6 {Bug [2262543fff] - Scale widget unexpectedly fires command call pack .s .s configure -command {set commandedVar} .s set 10 - update ; # -command callback shall fire + set timeout [after 500 {set $commandedVar "timeout"}] + vwait commandedVar ; # -command callback shall fire set res [list [.s get] $commandedVar] } -cleanup { destroy .s + after cancel $timeout } -result {10 10} test scale-20.7 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 7} -setup { catch {destroy .s} @@ -1519,10 +1523,12 @@ test scale-20.7 {Bug [2262543fff] - Scale widget unexpectedly fires command call scale .s -from 1 -to 50 -command {set commandedVar} pack .s .s set 10 - update ; # -command callback shall fire + set timeout [after 500 {set $commandedVar "timeout"}] + vwait commandedVar ; # -command callback shall fire set res [list [.s get] $commandedVar] } -cleanup { destroy .s + after cancel $timeout } -result {10 10} test scale-20.8 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 8} -setup { catch {destroy .s} @@ -1533,10 +1539,12 @@ test scale-20.8 {Bug [2262543fff] - Scale widget unexpectedly fires command call scale .s -from 1 -to 50 -variable scaleVar -command {set commandedVar} pack .s .s set 10 - update ; # -command callback shall fire + set timeout [after 500 {set $commandedVar "timeout"}] + vwait commandedVar ; # -command callback shall fire set res [list [.s get] $commandedVar] } -cleanup { destroy .s + after cancel $timeout } -result {10 10} test scale-21.1 {Bug [55b95f578a] - Associating variable with bignum value with scale crashes it} -setup { diff --git a/tests/spinbox.test b/tests/spinbox.test index f9e11b6..ea29f60 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -2013,11 +2013,13 @@ test spinbox-5.7 {ConfigureSpinbox procedure} -setup { } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo .e configure -width 5 format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.000000 0.363636} test spinbox-5.8 {ConfigureSpinbox procedure} -constraints { @@ -2203,10 +2205,12 @@ test spinbox-7.1 {InsertChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 2 XXX - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abXXXcde abXXXcde {0.000000 1.000000}} test spinbox-7.2 {InsertChars procedure} -setup { @@ -2218,10 +2222,12 @@ test spinbox-7.2 {InsertChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 500 XXX - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abcdeXXX abcdeXXX {0.000000 1.000000}} test spinbox-7.3 {InsertChars procedure} -setup { spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -2350,10 +2356,12 @@ test spinbox-8.1 {DeleteChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 2 4 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abe abe {0.000000 1.000000}} test spinbox-8.2 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2364,10 +2372,12 @@ test spinbox-8.2 {DeleteChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete -2 2 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {cde cde {0.000000 1.000000}} test spinbox-8.3 {DeleteChars procedure} -setup { unset -nocomplain contents @@ -2378,10 +2388,12 @@ test spinbox-8.3 {DeleteChars procedure} -setup { .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 3 1000 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo] } -cleanup { destroy .e + after cancel $timeout } -result {abc abc {0.000000 1.000000}} test spinbox-8.4 {DeleteChars procedure} -setup { spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 @@ -3163,30 +3175,36 @@ test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body { pack .e .e delete 0 end .e insert 0 123 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.000000 1.000000} test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e .e insert 0 0123456789abcdef .e xview 3 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.187500 0.812500} test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body { spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e .e insert 0 abcdefghijklmnopqrs .e xview 6 - update + set timeout [after 500 {set $scrollInfo "timeout"}] + vwait scrollInfo format {%.6f %.6f} {*}$scrollInfo } -cleanup { destroy .e + after cancel $timeout } -result {0.315789 0.842105} test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup { proc bgerror msg { @@ -3196,7 +3214,7 @@ test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup { } -body { spinbox .e -width 5 -xscrollcommand thisisnotacommand pack .e - update + vwait x list $x $errorInfo } -cleanup { destroy .e diff --git a/tests/textDisp.test b/tests/textDisp.test index 7245e91..b4891e4 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -11,6 +11,18 @@ eval tcltest::configure $argv tcltest::loadTestedCommands namespace import -force tcltest::test +# Platform specific procedure for updating the text widget. + +if {[tk windowingsystem] == "aqua"} { + proc updateText {} { + update idletasks + } +} else { + proc updateText {} { + update + } +} + # The procedure below is used as the scrolling command for the text; # it just saves the scrolling information in a variable "scrollInfo". @@ -77,7 +89,7 @@ wm withdraw . wm minsize . 1 1 wm positionfrom . user wm deiconify . -update +updateText # 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 @@ -158,7 +170,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} - update + updateText destroy .txt } {} @@ -171,7 +183,7 @@ test textDisp-0.4 {double tag elide transition} { .txt tag configure TRAFFIC -elide 1 .txt insert end "\n" {SYSTEM TRAFFIC} # Crash was here. - update + updateText destroy .txt } {} @@ -185,7 +197,7 @@ test textDisp-0.5 {double tag elide transition} { .txt insert end "\n" {SYSTEM TRAFFIC} .txt insert end "\n" WELCOME # Crash was here. - update + updateText destroy .txt } {} @@ -216,7 +228,7 @@ test textDisp-1.2 {GetStyle procedure, wrapmode} {textfonts} { .t tag configure x -wrap word .t tag configure y -wrap none .t tag raise y - update + updateText set result [list [.t bbox 2.20]] .t tag add x 2.0 2.1 lappend result [.t bbox 2.20] @@ -275,7 +287,7 @@ foreach m [.t mark names] { scan [wm geom .] %dx%d width height test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} {textfonts} { wm geom . [expr {$width+1}]x$height - update + updateText .t configure -wrap char .t delete 1.0 end .t insert 1.0 "This isxx some sample text for testing." @@ -283,7 +295,7 @@ test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} {textfonts} { list [.t bbox 1.19] [.t bbox 1.20] } [list [list 138 5 8 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]] wm geom . {} -update +updateText test textDisp-2.9 {LayoutDLine, marks and tags} {textfonts} { .t configure -wrap word .t delete 1.0 end @@ -535,33 +547,33 @@ test textDisp-3.1 {different character sizes} {textfonts} { test textDisp-4.1 {UpdateDisplayInfo, basic} {textfonts} { .t delete 1.0 end .t insert end "Line 1\nLine 2\nLine 3\n" - update + updateText .t delete 2.0 2.end - update + updateText set res $tk_textRelayout .t insert 2.0 "New Line 2" - update + updateText lappend res [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk_textRelayout } [list 2.0 [list 5 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] 2.0] test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {textfonts} { .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - update + updateText .t mark set x 2.21 .t delete 2.2 - update + updateText set res $tk_textRelayout .t insert 2.0 X - update + updateText lappend res [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list 2.0 2.20 [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 12 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] {2.0 2.20}] test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} {textfonts} { .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" - update + updateText .t mark set x 2.21 .t delete 2.2 - update + updateText list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } [list [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] {2.0 2.20}] .t mark unset x @@ -569,7 +581,7 @@ test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {textfonts} { .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" - update + updateText list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout } [list [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] {1.0 2.0 3.0}] test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} { @@ -577,11 +589,11 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} { wm overrideredirect . 1 } wm geom . 103x$height - update + updateText .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" - update + updateText list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout } [list [list 5 [expr {$fixedDiff + 18}] 1 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 1 $fixedHeight] {1.0 2.0 3.0}] if {$tcl_platform(platform) == "windows"} { @@ -601,20 +613,20 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} { frame .f2 -width 20 -height 100 pack .f2 -before .f wm geom . 103x103 - update + updateText .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" - update + updateText set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout] wm overrideredirect . 0 - update + updateText set x } [list [list 5 5 1 1] {} 1.0] catch {destroy .f2} .t configure -borderwidth 0 -wrap char wm geom . {} -update +updateText set bw [.t cget -borderwidth] set px [.t cget -padx] set py [.t cget -pady] @@ -633,28 +645,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 - update + updateText .t yview 16.0 - update + updateText set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] wm overrideredirect . 0 - update + updateText set x } {8.0 {16.0 17.0 15.0 14.0 13.0 12.0 11.0 10.0 9.0 8.0} {8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0}} test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} { .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 - update + updateText .t delete 5.0 14.0 - update + updateText 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} {textfonts} { .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 - update + updateText .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] } [list [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 2 * $fixedHeight}] $fixedWidth $fixedHeight] [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 7 * $fixedHeight}] $fixedWidth $fixedHeight]] @@ -662,18 +674,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 - update + updateText .t delete 13.0 end - update + updateText 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 - update + updateText .t delete 14.0 end - update + updateText 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} { @@ -682,11 +694,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 - update + updateText .t yview moveto 0 - update + updateText .t yview moveto 1 - update + updateText winfo ismapped .b } {0} .t configure -wrap word @@ -699,33 +711,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 - update + updateText .t yview scroll 3 units - update + updateText list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}} test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end .t yview 1.0 - update + updateText .t yview scroll 3 units - update + updateText 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 - update + updateText .t yview scroll -2 units - update + updateText 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 - update + updateText .t yview scroll -2 units - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -733,9 +745,9 @@ test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .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" - update + updateText .t xview scroll 3 units - update + updateText 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} {} [list 17 [expr {$fixedDiff + 16}] 7 $fixedHeight] {}] @@ -744,9 +756,9 @@ test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .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" - update + updateText .t xview scroll 100 units - update + updateText list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list {} {1.0 2.0 3.0 4.0} [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -754,10 +766,10 @@ test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .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" - update + updateText .t xview moveto 0 .t xview scroll -10 units - update + updateText list $tk_textRelayout $tk_textRedraw [.t bbox 2.5] } [list {} {1.0 2.0 3.0 4.0} [list 38 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -767,9 +779,9 @@ test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .t insert end "\nLine 3\nLine 4" .t xview moveto 0.0 .t xview scroll 100 units - update + updateText .t delete 2.30 2.44 - update + updateText list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } [list 2.0 {1.0 2.0 3.0 4.0} [list 108 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { @@ -778,9 +790,9 @@ test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {textfonts} { .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 - update + updateText .t xview moveto .6 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {}} test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {textfonts} { @@ -789,7 +801,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 - update + updateText .t configure -wrap word list [.t bbox 2.0] [.t bbox 2.16] } [list [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 10 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]] @@ -799,7 +811,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 - update + updateText .t configure -wrap char list [.t bbox 2.0] [.t bbox 2.16] } [list [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 115 [expr {$fixedDiff + 16}] 7 $fixedHeight]] @@ -817,7 +829,7 @@ test textDisp-5.1 {DisplayDLine, handling of spacing} {textfonts} { .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 - update + updateText list [winfo geometry .t.f1] [winfo geometry .t.f2] \ [winfo geometry .t.f3] [winfo geometry .t.f4] } [list 10x4+24+11 10x4+55+[expr {$fixedDiff/2 + 15}] 10x4+10+[expr {2*$fixedDiff + 43}] 10x4+76+[expr {2*$fixedDiff + 40}]] @@ -832,7 +844,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 - update + updateText list [winfo width .t.f] [winfo height .t.f] } [list 30 30] @@ -843,9 +855,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" } - update + updateText .t delete 2.0 3.0 - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 10.0} {2.0 10.0}} test textDisp-6.2 {scrolling in DisplayText, scroll down} { @@ -854,9 +866,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" } - update + updateText .t insert 2.0 "New Line 2\n" - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { @@ -866,10 +878,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" } - update + updateText .t insert 2.end "is so long that it wraps" .t insert 4.end "is so long that it wraps" - update + updateText 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} { @@ -879,10 +891,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" } - update + updateText .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" - update + updateText 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} {nonPortable} { @@ -894,9 +906,9 @@ test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {nonPortabl foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - update + updateText .t delete 1.6 1.end - update + updateText destroy .f2 list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}} @@ -911,41 +923,44 @@ test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {unix n foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - update + updateText .t delete 1.6 1.end destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {borders 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 - update ; .t count -update -ypixels 1.0 end ; update + updateText + .t count -update -ypixels 1.0 end + updateText 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" - update + updateText set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - update ; .t count -update -ypixels 1.0 end ; update + updateText + .t count -update -ypixels 1.0 end ; update set scrollInfo } [list 0.0 [expr {10.0/13}]] .t configure -yscrollcommand {} -xscrollcommand scroll test textDisp-6.9 {DisplayText, horizontal scrollbar updates} { .t configure -wrap none .t delete 1.0 end - update + updateText set scrollInfo unchanged .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - update + updateText set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua} { @@ -964,9 +979,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"} - update + updateText .t delete 2.0 3.0 - update + updateText list $tk_textEmbWinDisplay } {{4.0 6.0}} @@ -984,61 +999,61 @@ foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} { test textDisp-7.1 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.2 -relwidth 0.6 -rely 0.22 -relheight 0.55 - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {1.40 2.0 3.0 4.0 5.0 6.0}} test textDisp-7.2 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0 -relwidth 0.5 -rely 0 -relheight 0.5 - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20 1.40 2.0 3.0}} test textDisp-7.3 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.5 -relwidth 0.5 -rely 0.5 -relheight 0.5 - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 8.0}} test textDisp-7.4 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 0 -relheight 0.2 \ -bordermode ignore - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20}} test textDisp-7.5 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 1.0 -relheight 0.2 \ -anchor s -bordermode ignore - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {borders 7.0 8.0}} test textDisp-7.6 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \ -anchor w -bordermode ignore - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.7 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 1.0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \ -anchor e -bordermode ignore - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} { @@ -1047,9 +1062,9 @@ test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 place .f2 -in .t -relx 0.0 -relwidth 0.4 -rely 0.35 -relheight 0.4 \ -anchor nw -bordermode ignore - update + updateText destroy .f2 - update + updateText list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 eof}} .t configure -bd 0 @@ -1061,9 +1076,9 @@ test textDisp-8.1 {TkTextChanged: redisplay whole lines} {textfonts} { foreach i {3 4 5 6 7 8 9 10 11 12 13 14 15} { .t insert end "\nLine $i" } - update + updateText .t delete 2.36 2.38 - update + updateText list $tk_textRelayout $tk_textRedraw [.t bbox 2.32] } [list {2.0 2.18 2.38} {2.0 2.18 2.38} [list 101 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]] .t configure -wrap char @@ -1073,9 +1088,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" } - update + updateText .t insert 1.2 xx - update + updateText list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.3 {TkTextChanged} { @@ -1084,9 +1099,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" } - update + updateText .t insert 2.0 xx - update + updateText list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.4 {TkTextChanged} { @@ -1095,9 +1110,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" } - update + updateText .t delete 1.5 - update + updateText list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.5 {TkTextChanged} { @@ -1106,9 +1121,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" } - update + updateText .t delete 1.40 1.44 - update + updateText list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.6 {TkTextChanged} { @@ -1117,9 +1132,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" } - update + updateText .t delete 1.41 1.44 - update + updateText list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.7 {TkTextChanged} { @@ -1128,9 +1143,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" } - update + updateText .t delete 1.2 1.end - update + updateText list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 9.0 10.0}} test textDisp-8.8 {TkTextChanged} { @@ -1139,9 +1154,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" } - update + updateText .t delete 2.2 - update + updateText list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.9 {TkTextChanged} { @@ -1150,9 +1165,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" } - update + updateText .t delete 2.0 3.0 - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 8.0} {2.0 8.0}} test textDisp-8.10 {TkTextChanged} { @@ -1160,21 +1175,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 - update + updateText .t delete 2.19 - update + updateText 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 - update + updateText set scrollInfo "" .t insert end "a\nb\nc\n" # We need to wait for our asychronous callbacks to update the # scrollbar - update ; .t count -update -ypixels 1.0 end ; update + updateText + .t count -update -ypixels 1.0 end + updateText .t configure -yscrollcommand "" set scrollInfo } {0.0 0.625} @@ -1187,27 +1204,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 - update + updateText .t mark set insert 8.0 ; # up one line - update + updateText set res [list $tk_textRedraw] .t mark set insert 12.2 ; # in the visible text - update + updateText lappend res $tk_textRedraw .t mark set insert 6.5 ; # in the hidden text - update + updateText lappend res $tk_textRedraw .t mark set insert 3.5 ; # in the visible text again - update + updateText lappend res $tk_textRedraw .t mark set insert 3.8 ; # within the same line - update + updateText 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 - update + updateText .t insert 3.0 "" .t delete 1.0 2.0 update idletasks @@ -1217,62 +1234,62 @@ test textDisp-9.1 {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" - update + updateText .t tag add big 2.2 2.4 - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 2.18} {2.0 2.18}} test textDisp-9.2 {TkTextRedrawTag} {textfonts} { .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" - update + updateText .t tag add big 1.2 2.4 - update + updateText list $tk_textRelayout $tk_textRedraw } {{1.0 2.0 2.17} {1.0 2.0 2.17}} 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" - update + updateText .t tag add big 2.2 2.4 - update + updateText .t tag remove big 1.0 end - update + updateText 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" - update + updateText .t tag add big 2.2 2.20 - update + updateText .t tag remove big 1.0 end - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.5 {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" - update + updateText .t tag add big 2.2 2.end - update + updateText .t tag remove big 1.0 end - update + updateText list $tk_textRelayout $tk_textRedraw } {{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" - update + updateText .t tag add big 2.2 3.5 - update + updateText .t tag remove big 1.0 end - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}} test textDisp-9.7 {TkTextRedrawTag} { @@ -1280,9 +1297,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 - update + updateText .t tag remove big 2.19 - update + updateText set tk_textRedraw } {2.0 2.20 eof} test textDisp-9.8 {TkTextRedrawTag} {textfonts} { @@ -1290,9 +1307,9 @@ test textDisp-9.8 {TkTextRedrawTag} {textfonts} { .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 - update + updateText .t tag add big 2.0 2.5 - update + updateText set tk_textRedraw } {2.0 2.17} test textDisp-9.9 {TkTextRedrawTag} {textfonts} { @@ -1300,9 +1317,9 @@ test textDisp-9.9 {TkTextRedrawTag} {textfonts} { .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 - update + updateText .t tag add big 1.5 2.5 - update + updateText set tk_textRedraw } {2.0 2.17} test textDisp-9.10 {TkTextRedrawTag} { @@ -1310,10 +1327,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 - update + updateText set tk_textRedraw {none} .t tag add big 1.3 1.5 - update + updateText set tk_textRedraw } {none} test textDisp-9.11 {TkTextRedrawTag} { @@ -1321,9 +1338,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 - update + updateText .t tag add big 1.0 2.0 - update + updateText set tk_textRedraw } {} test textDisp-9.12 {TkTextRedrawTag} { @@ -1334,9 +1351,9 @@ test textDisp-9.12 {TkTextRedrawTag} { } .t tag configure hidden -elide true .t tag add hidden 2.6 3.6 - update + updateText .t tag add hidden 3.11 4.6 - update + updateText list $tk_textRelayout $tk_textRedraw } {2.0 {2.0 eof}} test textDisp-9.13 {TkTextRedrawTag} { @@ -1349,9 +1366,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 - update + updateText .t tag configure hidden -elide false - update + updateText list $tk_textRelayout $tk_textRedraw } {{2.0 6.0 7.0} {2.0 6.0 7.0}} test textDisp-9.14 {TkTextRedrawTag} { @@ -1361,7 +1378,7 @@ test textDisp-9.14 {TkTextRedrawTag} { } .tnocrash tag configure mytag1 -relief raised .tnocrash tag configure mytag2 -relief solid - update + updateText proc doit {} { .tnocrash tag add mytag1 4.0 5.0 .tnocrash tag add mytag2 4.0 5.0 @@ -1383,9 +1400,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" - update + updateText .t configure -bg black - update + updateText 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] @@ -1399,7 +1416,7 @@ test textDisp-10.2 {TkTextRelayoutWindow} { .top.t see insert tkwait visibility .top.t place .top.t -width 150 -height 100 - update + updateText .top.t index @0,0 } {1.0} catch {destroy .top} @@ -1409,96 +1426,96 @@ catch {destroy .top} for {set i 2} {$i <= 200} {incr i} { .t insert end "\nLine $i" } -update +updateText test textDisp-11.1 {TkTextSetYView} { .t yview 30.0 - update + updateText .t index @0,0 } {30.0} test textDisp-11.2 {TkTextSetYView} { .t yview 30.0 - update + updateText .t yview 32.0 - update + updateText list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.3 {TkTextSetYView} { .t yview 30.0 - update + updateText .t yview 28.0 - update + updateText list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.4 {TkTextSetYView} { .t yview 30.0 - update + updateText .t yview 31.4 - update + updateText list [.t index @0,0] $tk_textRedraw } {31.0 40.0} test textDisp-11.5 {TkTextSetYView} { .t yview 30.0 - update + updateText set tk_textRedraw {} .t yview -pickplace 31.0 - update + updateText list [.t index @0,0] $tk_textRedraw } {30.0 {}} test textDisp-11.6 {TkTextSetYView} { .t yview 30.0 - update + updateText set tk_textRedraw {} .t yview -pickplace 28.0 - update + updateText list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.7 {TkTextSetYView} { .t yview 30.0 - update ; update + updateText set tk_textRedraw {} .t yview -pickplace 26.0 - update + updateText list [.t index @0,0] $tk_textRedraw } {21.0 {21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}} test textDisp-11.8 {TkTextSetYView} { .t yview 30.0 - update + updateText set tk_textRedraw {} .t yview -pickplace 41.0 - update + updateText list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.9 {TkTextSetYView} { .t yview 30.0 - update + updateText set tk_textRedraw {} .t yview -pickplace 43.0 - update + updateText 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 - update + updateText set tk_textRedraw {} .t yview 10000.0 - update + updateText 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 - update + updateText set tk_textRedraw {} .t yview 197.0 - update + updateText list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}} test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} { .t insert 10.0 "Long line with enough text to wrap\n" .t yview 1.0 - update + updateText set tk_textRedraw {} .t see 10.30 - update + updateText list [.t index @0,0] $tk_textRedraw } {2.0 10.20} .t delete 10.0 11.0 @@ -1512,15 +1529,15 @@ test textDisp-11.13 {TkTestSetYView, partially visible last line} { for {set i 2} {$i <= 100} {incr i} { .top.t insert end "\nLine $i" } - update + updateText scan [wm geometry .top] "%dx%d" w2 h2 wm geometry .top ${w2}x[expr {$h2-2}] - update + updateText .top.t yview 1.0 - update + updateText set tk_textRedraw {} .top.t see 5.0 - update + updateText # 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 @@ -1534,29 +1551,29 @@ pack .top.t for {set i 2} {$i <= 20} {incr i} { .top.t insert end "\nLine $i" } -update +updateText test textDisp-11.14 {TkTextSetYView, only a few lines visible} { .top.t yview 5.0 - update + updateText .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 - update + updateText .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 - update + updateText .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 - update + updateText .top.t see 4.0 .top.t index @0,0 # The index 2.0 should be just visible by a couple of pixels @@ -1571,7 +1588,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 - update + updateText .top.t see "8.0 lineend" # The index "8.0 lineend" is on screen despite elided -> no scroll .top.t index @0,0 @@ -1591,19 +1608,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 - update + updateText .top.t see 21.0 - update + updateText set ind1 [.top.t index @0,0] .top.t see end - update + updateText .top.t see 17.0 - update + updateText set ind2 [.top.t index @0,0] .top.t see end - update + updateText .top.t see 15.0 - update + updateText set ind3 [.top.t index @0,0] list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}] } {1 1} @@ -1626,7 +1643,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}] - update + updateText .top.t see 1.0 .top.t index @0,[expr {$lineheight - 2}] } {1.0} @@ -1636,38 +1653,38 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height} .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 - update + updateText .t yview -pickplace 52.0 - update + updateText .t index @0,0 } {49.0} test textDisp-12.2 {MeasureUp} { .t yview 100.0 - update + updateText .t yview -pickplace 53.0 - update + updateText .t index @0,0 } {50.0} test textDisp-12.3 {MeasureUp} { .t yview 100.0 - update + updateText .t yview -pickplace 50.10 - update + updateText .t index @0,0 } {45.0} .t configure -wrap none test textDisp-12.4 {MeasureUp} { .t yview 100.0 - update + updateText .t yview -pickplace 53.0 - update + updateText .t index @0,0 } {48.0} test textDisp-12.5 {MeasureUp} { .t yview 100.0 - update + updateText .t yview -pickplace 50.10 - update + updateText .t index @0,0 } {45.0} @@ -1690,7 +1707,7 @@ test textDisp-13.3 {TkTextSeeCmd procedure} { test textDisp-13.4 {TkTextSeeCmd procedure} { .t xview moveto 0 .t yview moveto 0 - update + updateText .t see 4.2 .t index @0,0 } {1.0} @@ -1698,7 +1715,7 @@ test textDisp-13.5 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - update + updateText .t see 12.1 .t index @0,0 } {3.0} @@ -1706,7 +1723,7 @@ test textDisp-13.6 {TkTextSeeCmd procedure} { .t configure -wrap char .t xview moveto 0 .t yview moveto 0 - update + updateText .t see 30.50 set x [.t index @0,0] .t configure -wrap none @@ -1717,7 +1734,7 @@ test textDisp-13.7 {TkTextSeeCmd procedure} {textfonts} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.40 - update + updateText .t see 30.50 .t yview 25.0 .t see 30.50 @@ -1734,7 +1751,7 @@ test textDisp-13.8 {TkTextSeeCmd procedure} {textfonts} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - update + updateText .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1750,7 +1767,7 @@ test textDisp-13.9 {TkTextSeeCmd procedure} {textfonts} { .t yview moveto 0 .t tag add sel 30.20 .t tag add sel 30.50 - update + updateText .t see 30.50 set x [list [.t bbox 30.50]] .t see 30.60 @@ -1782,13 +1799,13 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} { } wm geometry .top2 300x200+0+0 - update + updateText .top2.t2 see "1.0 lineend" - update + updateText set ref [.top2.t2 index @0,0] .top2.t2 insert "1.0 lineend" ç .top2.t2 see "1.0 lineend" - update + updateText set new [.top2.t2 index @0,0] set res [.top2.t2 compare $ref == $new] destroy .top2 @@ -1799,7 +1816,7 @@ wm geom . {} .t configure -wrap none test textDisp-14.1 {TkTextXviewCmd procedure} { .t delete 1.0 end - update + updateText .t insert end xxxxxxxxx\n .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" @@ -1809,7 +1826,7 @@ test textDisp-14.1 {TkTextXviewCmd procedure} { .t configure -wrap char test textDisp-14.2 {TkTextXviewCmd procedure} { .t delete 1.0 end - update + updateText .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -1818,7 +1835,7 @@ test textDisp-14.2 {TkTextXviewCmd procedure} { .t configure -wrap none test textDisp-14.3 {TkTextXviewCmd procedure} { .t delete 1.0 end - update + updateText .t insert end xxxxxxxxx\n .t insert end "xxxxx\n" .t insert end "xxxx" @@ -1911,43 +1928,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 - update + updateText .t yview scroll -3 units .t index @0,0 } {42.0} test textDisp-15.2 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - update + updateText .t yview scroll -2 units .t index @0,0 } {50.20} test textDisp-15.3 {ScrollByLines procedure, scrolling backwards} { .t yview 51.0 - update + updateText .t yview scroll -4 units .t index @0,0 } {49.0} test textDisp-15.4 {ScrollByLines procedure, scrolling backwards} { .t yview 50.20 - update + updateText .t yview scroll -2 units .t index @0,0 } {49.0} test textDisp-15.5 {ScrollByLines procedure, scrolling backwards} { .t yview 50.40 - update + updateText .t yview scroll -2 units .t index @0,0 } {50.0} test textDisp-15.6 {ScrollByLines procedure, scrolling backwards} { .t yview 3.2 - update + updateText .t yview scroll -5 units .t index @0,0 } {1.0} test textDisp-15.7 {ScrollByLines procedure, scrolling forwards} { .t yview 48.0 - update + updateText .t yview scroll 4 units .t index @0,0 } {50.40} @@ -1973,7 +1990,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" } - update ; after 1000 ; update + updateText 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 @@ -1993,7 +2010,8 @@ 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 enoug extra text to wrap.} -update ; .t count -update -ypixels 1.0 end +updateText +.t count -update -ypixels 1.0 end test textDisp-16.1 {TkTextYviewCmd procedure} { .t yview 21.0 set x [.t yview] @@ -2014,7 +2032,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 - update + updateText .t yview 98 .t index @0,0 } {99.0} @@ -2069,7 +2087,7 @@ test textDisp-16.18 {TkTextYviewCmd procedure, "moveto" roundoff} {textfonts} { text .top1.t -height 3 -width 4 -wrap none -setgrid 1 -padx 6 \ -spacing3 6 pack .top1.t - update + updateText .top1.t insert end "1\n2\n3\n4\n5\n6" .top1.t yview moveto 0.3333 set result [.top1.t yview] @@ -2090,7 +2108,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 - update + updateText .t yview scroll -1 pages .t index @0,0 } {42.0} @@ -2099,42 +2117,42 @@ 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 - update + updateText .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 - update + updateText .t yview scroll -3 pa .t index @0,0 } {1.0} test textDisp-16.25 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t configure -height 1 - update + updateText .t yview 50.0 - update + updateText .t yview scroll -1 pages set x [.t index @0,0] .t configure -height 10 - update + updateText set x } {49.0} test textDisp-16.26 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t yview 50.0 - update + updateText .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 - update + updateText .t yview scroll 2 pages .t index @0,0 } {66.0} test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} {textfonts} { .t yview 98.0 - update + updateText .t yview scroll 1 page set res [expr {int([.t index @0,0])}] if {$fixedDiff > 1} { @@ -2144,24 +2162,24 @@ test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} { } {102} test textDisp-16.29 {TkTextYviewCmd procedure, "scroll" option, forward pages} { .t configure -height 1 - update + updateText .t yview 50.0 - update + updateText .t yview scroll 1 pages set x [.t index @0,0] .t configure -height 10 - update + updateText set x } {51.0} test textDisp-16.30 {TkTextYviewCmd procedure, "scroll units" option} { .t yview 45.0 - update + updateText .t yview scroll -3 units .t index @0,0 } {42.0} test textDisp-16.31 {TkTextYviewCmd procedure, "scroll units" option} { .t yview 149.0 - update + updateText .t yview scroll 4 units .t index @0,0 } {151.40} @@ -2266,7 +2284,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 - update + updateText .t index @0,0 } {5.0} test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { @@ -2280,7 +2298,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 - update + updateText .t index @0,0 } {5.0} test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} { @@ -2291,9 +2309,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 - update + updateText .t see [expr {5 + [winfo height .t] / $fixedHeight + 1}].0 - update + updateText .t index @0,0 } {2.0} @@ -2369,7 +2387,7 @@ test textDisp-18.1 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - update + updateText set scrollInfo } [list 0.0 [expr {4.0/11}]] test textDisp-18.2 {GetXView procedure} { @@ -2378,13 +2396,13 @@ test textDisp-18.2 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx - update + updateText set scrollInfo } {0.0 1.0} test textDisp-18.3 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end - update + updateText set scrollInfo } {0.0 1.0} test textDisp-18.4 {GetXView procedure} { @@ -2393,7 +2411,7 @@ test textDisp-18.4 {GetXView procedure} { .t insert end xxxxxxxxx\n .t insert end xxxxxx\n .t insert end xxxxxxxxxxxxxxxxx - update + updateText set scrollInfo } {0.0 1.0} test textDisp-18.5 {GetXView procedure} { @@ -2403,7 +2421,7 @@ test textDisp-18.5 {GetXView procedure} { .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx .t xview scroll 31 units - update + updateText set scrollInfo } [list [expr {31.0/55}] [expr {51.0/55}]] test textDisp-18.6 {GetXView procedure} { @@ -2414,27 +2432,27 @@ test textDisp-18.6 {GetXView procedure} { .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" .t xview moveto 0 .t xview scroll 31 units - update + updateText set x {} lappend x $scrollInfo .t configure -wrap char - update + updateText lappend x $scrollInfo .t configure -wrap word - update + updateText lappend x $scrollInfo .t configure -wrap none - update + updateText 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 - update + updateText set scrollInfo unchanged .t insert end xxxxxx\n .t insert end xxx - update + updateText set scrollInfo } {unchanged} test textDisp-18.8 {GetXView procedure} { @@ -2448,10 +2466,10 @@ test textDisp-18.8 {GetXView procedure} { .t configure -wrap none .t delete 1.0 end .t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n - update + updateText .t delete 1.0 end .t configure -xscrollcommand scrollError - update + updateText set x } {{scrolling error} {scrolling error while executing @@ -2468,37 +2486,37 @@ catch {rename bogus {}} test textDisp-19.1 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - update + updateText set scrollInfo } {0.0 1.0} test textDisp-19.2 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - update + updateText set scrollInfo "unchanged" .t insert 1.0 "Line1\nLine2" - update + updateText set scrollInfo } {unchanged} test textDisp-19.3 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end - update; after 10 ; update + updateText set scrollInfo "unchanged" .t insert 1.0 "Line 1\nLine 2 is so long that it wraps around\nLine 3" - update + updateText set scrollInfo } {unchanged} test textDisp-19.4 {GetYView procedure} { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1" - update + updateText set scrollInfo "unchanged" foreach i {2 3 4 5 6 7 8 9 10 11 12 13} { .t insert end "\nLine $i" } - update + updateText set scrollInfo } [list 0.0 [expr {70.0/91}]] test textDisp-19.5 {GetYView procedure} { @@ -2509,7 +2527,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" - update ; after 100 + updateText set x $scrollInfo } {0.0 0.625} test textDisp-19.6 {GetYView procedure} { @@ -2521,7 +2539,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 - update + updateText set x $scrollInfo } {0.375 1.0} test textDisp-19.7 {GetYView procedure} { @@ -2533,7 +2551,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 - update; after 1; update + updateText set x $scrollInfo } {0.125 0.75} test textDisp-19.8 {GetYView procedure} { @@ -2545,7 +2563,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 - update + updateText .t count -update -ypixels 1.0 end set x $scrollInfo } {0.0625 0.6875} @@ -2557,7 +2575,7 @@ test textDisp-19.9 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 3.0 - update + updateText set scrollInfo } [list [expr {4.0/30}] 0.8] test textDisp-19.10 {GetYView procedure} { @@ -2568,7 +2586,7 @@ test textDisp-19.10 {GetYView procedure} { .t insert end "\nLine $i" } .t yview 11.0 - update + updateText set scrollInfo } [list [expr {1.0/3}] 1.0] test textDisp-19.10.1 {Widget manipulation causes height miscount} { @@ -2579,7 +2597,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} { .t insert end "\nLine $i" } .t yview 11.0 - update + updateText .t configure -wrap word .t delete 1.0 end .t insert 1.0 "Line 1" @@ -2589,7 +2607,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 - update + updateText .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -2603,7 +2621,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 - update + updateText .t count -update -ypixels 1.0 end set scrollInfo } {0.5 1.0} @@ -2741,10 +2759,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. - update ; after 10 + updateText scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - update + updateText .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} {textfonts} { @@ -2755,10 +2773,10 @@ test textDisp-19.13 {GetYView procedure, partially visible last line} {textfonts 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. - update ; after 10 + updateText scan [wm geom .top] %dx%d twidth theight wm geom .top ${twidth}x[expr {$theight - 3}] - update + updateText .top.t yview } [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]] catch {destroy .top} @@ -2772,13 +2790,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. - update ; .t count -update -ypixels 1.0 end - update ; after 10 ; update + updateText + .t count -update -ypixels 1.0 end + updateText set scrollInfo "unchanged" .t mark set insert 3.0 .t tag configure x -background red .t tag add x 1.0 5.0 - update + updateText .t tag delete x set scrollInfo } {unchanged} @@ -2791,14 +2810,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." - update + updateText .t configure -yscrollcommand scrollError proc bgerror args { global x errorInfo errorCode set x [list $args $errorInfo $errorCode] } .t delete 1.0 end - update + updateText rename bgerror {} .t configure -yscrollcommand scroll set x @@ -2820,7 +2839,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. - update ; .t count -update -ypixels 1.0 end ; update + updateText + .t count -update -ypixels 1.0 end + updateText set res {} lappend res \ [.t count -ypixels 1.0 end] \ @@ -2871,7 +2892,7 @@ test textDisp-19.18 {count -ypixels with indices in elided lines} { update lappend res [.t count -ypixels 5.0 25.0] .t yview scroll [expr {- 15 * $fixedHeight}] pixels - update + updateText 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} { @@ -2884,7 +2905,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 - update + updateText 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 @@ -2976,7 +2997,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" -update +updateText .t tag add x 50.1 test textDisp-22.1 {TkTextCharBbox} {textfonts} { .t config -wrap word @@ -2993,21 +3014,21 @@ test textDisp-22.3 {TkTextCharBbox, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - update + updateText list [.t bbox 19.1] [.t bbox 20.1] } [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] [list 10 [expr {3+10*$fixedHeight}] 7 3]] test textDisp-22.4 {TkTextCharBbox, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - update + updateText list [.t bbox 19.1] [.t bbox 20.1] } [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] [list 10 [expr {3+10*$fixedHeight}] 7 5]] test textDisp-22.5 {TkTextCharBbox, cut-off char} {textfonts} { .t config -wrap none .t yview 10.0 wm geom . [expr {$width-95}]x$height - update + updateText .t bbox 15.6 } [list 45 [expr {3+5*$fixedHeight}] 7 $fixedHeight] test textDisp-22.6 {TkTextCharBbox, line visible but not char} {textfonts} { @@ -3015,16 +3036,16 @@ test textDisp-22.6 {TkTextCharBbox, line visible but not char} {textfonts} { .t yview 10.0 .t tag add big 20.2 20.5 wm geom . ${width}x[expr {$height+3}] - update + updateText list [.t bbox 19.1] [.t bbox 20.1] [.t bbox 20.2] } [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] {} [list 17 [expr {3+10*$fixedHeight}] 14 7]] wm geom . {} -update +updateText test textDisp-22.7 {TkTextCharBbox, different character sizes} {textfonts} { .t config -wrap char .t yview 10.0 .t tag add big 12.2 12.5 - update + updateText list [.t bbox 12.1] [.t bbox 12.2] } [list [list 10 [expr {3 + 2*$fixedHeight + $ascentDiff}] 7 $fixedHeight] [list 17 [expr {3+ 2*$fixedHeight}] 14 27]] .t tag remove big 1.0 end @@ -3051,7 +3072,7 @@ test textDisp-22.9 {TkTextCharBbox, handling of spacing} {textfonts} { .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 - update + updateText 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 24 11 10 4] [list 55 [expr {$fixedDiff/2 + 15}] 10 4] [list 10 [expr {2*$fixedDiff + 43}] 10 4] [list 76 [expr {2*$fixedDiff + 40}] 10 4] [list 10 11 7 $fixedHeight] [list 69 [expr {$fixedDiff + 34}] 7 $fixedHeight]] @@ -3065,7 +3086,7 @@ test textDisp-22.10 {TkTextCharBbox, handling of elided lines} {textfonts} { .t tag add hidden 2.8 2.13 .t tag add hidden 6.8 7.13 .t tag configure hidden -elide true - update + updateText 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]}] \ @@ -3087,7 +3108,7 @@ test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} {textfont } .t tag add hidden 1.30 2.5 .t tag configure hidden -elide true - update + updateText 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]}] @@ -3101,7 +3122,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" -update +updateText test textDisp-23.1 {TkTextDLineInfo} {textfonts} { .t config -wrap word .t yview 48.0 @@ -3110,14 +3131,14 @@ test textDisp-23.1 {TkTextDLineInfo} {textfonts} { } [list {} [list 3 3 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {4*$fixedDiff + 55}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}] test textDisp-23.2 {TkTextDLineInfo} {textfonts} { .t config -bd 4 -wrap word - update + updateText .t yview 48.0 .t dlineinfo 50.40 } [list 7 [expr {4*$fixedDiff + 59}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] .t config -bd 0 test textDisp-23.3 {TkTextDLineInfo} {textfonts} { .t config -wrap none - update + updateText .t yview 48.0 list [.t dlineinfo 50.40] [.t dlineinfo 57.3] } [list [list 3 [expr {2*$fixedDiff + 29}] 371 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]] @@ -3125,18 +3146,18 @@ test textDisp-23.4 {TkTextDLineInfo, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height-1}] - update + updateText list [.t dlineinfo 19.0] [.t dlineinfo 20.0] } [list [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {10*$fixedDiff + 133}] 49 3 [expr {$fixedDiff + 10}]]] test textDisp-23.5 {TkTextDLineInfo, cut-off lines} {textfonts} { .t config -wrap char .t yview 10.0 wm geom . ${width}x[expr {$height+1}] - update + updateText list [.t dlineinfo 19.0] [.t dlineinfo 20.0] } [list [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {10*$fixedDiff + 133}] 49 5 [expr {$fixedDiff + 10}]]] wm geom . {} -update +updateText test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {textfonts} { .t config -wrap none .t delete 1.0 end @@ -3144,7 +3165,7 @@ test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {textfonts} { .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 - update + updateText list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0] } [list [list -39 3 70 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list -39 [expr {$fixedDiff + 16}] 364 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list -39 [expr {2*$fixedDiff + 29}] 35 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]] .t xview moveto 0 @@ -3173,7 +3194,7 @@ test textDisp-24.2 {TkTextCharLayoutProc} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width+1}]x$height - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 12 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.3 {TkTextCharLayoutProc} {textfonts} { @@ -3181,7 +3202,7 @@ test textDisp-24.3 {TkTextCharLayoutProc} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width-1}]x$height - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 10 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {textfonts} { @@ -3189,7 +3210,7 @@ test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {textfonts} { .t delete 1.0 end .t insert 1.0 01234567890123456789\n012345678901234567890 wm geom . {} - update + updateText list [.t bbox 1.19] [.t bbox 1.20] [.t bbox 2.20] } [list [list 136 3 7 $fixedHeight] [list 143 3 0 $fixedHeight] [list 3 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]] test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} {unix textfonts} { @@ -3197,7 +3218,7 @@ test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} .t delete 1.0 end .t insert 1.0 0\n1\n wm geom . 110x$height - update + updateText list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 2.0] } [list [list 3 3 4 $fixedHeight] [list 7 3 0 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 4 $fixedHeight]] test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3205,7 +3226,7 @@ test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} {textfonts} { .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 . {} - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3213,7 +3234,7 @@ test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {textfonts} { .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 - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 12 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3221,7 +3242,7 @@ test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} {textfonts} { .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 - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 10 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3229,7 +3250,7 @@ test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} {textfonts} { .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 - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 5 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} {textfonts} { @@ -3237,7 +3258,7 @@ test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} {textfonts} { .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 - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 4 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't quite fit} {textfonts} { @@ -3245,7 +3266,7 @@ test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't qui .t delete 1.0 end .t insert 1.0 "01234567890123456789 \nabcdefg" wm geom . [expr {$width-2}]x$height - update + updateText set result {} lappend result [.t bbox 1.21] [.t bbox 2.0] .t mark set insert 1.21 @@ -3264,7 +3285,7 @@ test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . {} - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] {}] test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} {textfonts} { @@ -3272,7 +3293,7 @@ test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width+1}]x$height - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 143 3 5 $fixedHeight]] test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {textfonts} { @@ -3280,7 +3301,7 @@ test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . [expr {$width-1}]x$height - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 143 3 3 $fixedHeight]] test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {textfonts} { @@ -3291,7 +3312,7 @@ test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {textfonts} { .t delete 1.0 end .t insert 1.0 "abcdefghijklmnopqrstuvwxyz" wm geom . 103x$height - update + updateText list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2] } [list [list 3 3 1 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 1 $fixedHeight] [list 3 [expr {2*$fixedDiff + 29}] 1 $fixedHeight]] if {$tcl_platform(platform) == "windows"} { @@ -3302,7 +3323,7 @@ test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} {textfonts} { .t delete 1.0 end .t insert 1.0 "This is a line that wraps around" wm geom . {} - update + updateText list [.t bbox 1.19] [.t bbox 1.20] } [list [list 136 3 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} {textfonts} { @@ -3310,7 +3331,7 @@ test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} {textfonts} { .t delete 1.0 end .t insert 1.0 "xxThis is a line that wraps around" wm geom . {} - update + updateText list [.t bbox 1.15] [.t bbox 1.16] [.t bbox 1.17] } [list [list 108 3 7 $fixedHeight] [list 115 3 28 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]] test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} {textfonts} { @@ -3318,7 +3339,7 @@ test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} {textfonts} { .t delete 1.0 end .t insert 1.0 "xxThis is a line that wraps around" wm geom . {} - update + updateText list [.t bbox 1.14] [.t bbox 1.15] [.t bbox 1.16] } [list [list 101 3 7 $fixedHeight] [list 108 3 7 $fixedHeight] [list 115 3 28 $fixedHeight]] test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {textfonts} { @@ -3336,7 +3357,7 @@ test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {textfonts} { set result } [list [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 19}] [expr {$fixedDiff + 16}]] [list 10 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 15}] [expr {$fixedDiff + 10}]]] .t configure -width 30 -update +updateText test textDisp-24.21 {TkTextCharLayoutProc, word breaks} {textfonts} { .t configure -wrap word .t delete 1.0 end @@ -3366,7 +3387,7 @@ test textDisp-24.23 {TkTextCharLayoutProc, word breaks} {textfonts} { } [list 3 [expr {2*$fixedDiff + 29}] 30 20] catch {destroy .t.f} .t configure -width 20 -update +updateText test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} {textfonts} { .t delete 1.0 end .t tag configure x -justify center @@ -3379,7 +3400,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints pack .tt } -body { .tt insert end \t9\n\t99\n\t999 - update + updateText list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3] } -cleanup { destroy .tt @@ -3387,7 +3408,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \ -tabs 100 -update +updateText test textDisp-25.1 {CharBboxProc procedure, check tab width} {textfonts} { .t delete 1.0 end .t insert 1.0 abc\td\tfgh @@ -3396,7 +3417,7 @@ test textDisp-25.1 {CharBboxProc procedure, check tab width} {textfonts} { .t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \ -tabs {} -update +updateText test textDisp-26.1 {AdjustForTab procedure, no tabs} {textfonts} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -3519,7 +3540,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 - update + updateText lindex [.t bbox 1.5] 0 } {120} test textDisp-26.13 {AdjustForTab procedure, not enough space} {textfonts} { @@ -3566,7 +3587,7 @@ test textDisp-26.14.2 {AdjustForTab procedure, not enough space} {textfonts} { .t configure -width 20 -bd 2 -highlightthickness 2 -relief sunken -tabs {} \ -wrap char -update +updateText test textDisp-27.1 {SizeOfTab procedure, old-style tabs} {textfonts} { .t delete 1.0 end .t insert 1.0 a\tbcdefghij\tc\td @@ -3635,7 +3656,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 {4 + int(0.5 + $tab + $cm)}] - update + updateText set res [.t bbox 2.23] lset res 0 [expr {[lindex $res 0] - $tab}] set res @@ -3656,7 +3677,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 {4 + int(0.5 + $tab + $cm)}] - update + updateText set res [.t bbox 2.23] .t configure -tabstyle tabular lset res 0 [expr {[lindex $res 0] - $tab}] @@ -3671,17 +3692,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] - update + updateText set res [.t bbox 1.20] # Now, Tk's interpolated tabs should be the same as # non-interpolated. .t configure -tabs $precisetab - update + updateText expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]} } {0} .t configure -wrap char -tabs {} -width 20 -update +updateText test textDisp-27.8 {SizeOfTab procedure, right alignment} {textfonts} { .t delete 1.0 end .t insert 1.0 a\t\txyzzyabc @@ -3725,11 +3746,11 @@ test textDisp-28.1 {"yview" option with bizarre scroll command} { .t2.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n" pack .t2.t wm geometry .t2 +0+0 - update + updateText .t2.t configure -yscrollcommand bizarre_scroll .t2.t yview 100.0 set result [.t2.t index @0,0] - update + updateText lappend result [.t2.t index @0,0] } {6.0 1.0} @@ -3745,7 +3766,7 @@ test textDisp-29.1 {miscellaneous: lines wrap but are still too long} {textfonts .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 - update + updateText list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list 0.0 [expr {20.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]] test textDisp-29.2 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3760,9 +3781,9 @@ test textDisp-29.2 {miscellaneous: lines wrap but are still too long} {textfonts .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 - update + updateText .t2.t xview scroll 1 unit - update + updateText list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - $fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - $fixedWidth}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]] test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3776,9 +3797,9 @@ test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} {textfon pack .t2.s -side bottom -fill x .t2.t insert end 1\n .t2.t insert end [string repeat "abc" 30] - update + updateText .t2.t xview scroll 5 unit - update + updateText .t2.t xview } [list [expr {5.0/90}] [expr {25.0/90}]] test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3793,9 +3814,9 @@ test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} {textfon .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 - update + updateText .t2.t xview scroll 2 unit - update + updateText list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - 2*$fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}] test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3810,9 +3831,9 @@ test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} {textfon .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 - update + updateText .t2.t xview scroll 7 pixels - update + updateText list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth + 7)/300}]] 300x50+[expr {$twbw + $twht + 1 - 7}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - 7}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]] test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} {textfonts} { @@ -3827,9 +3848,9 @@ test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} {textfon .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 - update + updateText .t2.t xview scroll 17 pixels - update + updateText list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth + 17)/300}]] 300x50+[expr {$twbw + $twht + 1 - 17}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}] test textDisp-29.2.5 {miscellaneous: can show last character} { @@ -3846,7 +3867,7 @@ test textDisp-29.2.5 {miscellaneous: can show last character} { grid columnconfigure .t2 0 -weight 1 grid rowconfigure .t2 0 -weight 1 grid rowconfigure .t2 1 -weight 0 - update ; update + updateText set xv [.t2.t xview] set xd [expr {[lindex $xv 1] - [lindex $xv 0]}] .t2.t xview moveto [expr {1.0-$xd}] @@ -3872,9 +3893,9 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} {textfonts .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 - update + updateText .t2.t xview scroll 200 units - update + updateText list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3] } [list [list [expr {16.0/30}] 1.0] 300x50+-155+[expr {$fixedDiff + 18}] {}] test textDisp-30.1 {elidden text joining multiple logical lines} { @@ -3894,7 +3915,7 @@ test textDisp-30.2 {elidden text joining multiple logical lines} { catch {destroy .t2} .t configure -height 1 -update +updateText test textDisp-31.1 {line embedded window height update} { set res {} @@ -3912,7 +3933,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 - update + updateText lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -3934,7 +3955,7 @@ test textDisp-31.3 {line update index shifting} { # have been performed. set res {} .t.f configure -height 100 - update + updateText lappend res [.t count -update -ypixels 1.0 end] .t.f configure -height 10 .t insert 1.0 "abc\n" @@ -3955,7 +3976,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 - update + updateText lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 lappend res [.t count -ypixels 1.0 end] @@ -3966,7 +3987,7 @@ test textDisp-31.4 {line embedded image height update} { test textDisp-31.5 {line update index shifting} { set res {} textest configure -height 100 - update ; after 1000 ; update + updateText lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 .t insert 1.0 "abc\n" @@ -3988,7 +4009,6 @@ test textDisp-31.6 {line update index shifting} { # have been performed. set res {} textest configure -height 100 - update ; after 1000 ; update lappend res [.t count -update -ypixels 1.0 end] textest configure -height 10 .t insert 1.0 "abc\n" @@ -4031,19 +4051,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 - update ; update ; update ; update + updateText destroy .tt } {} test textDisp-32.1 {everything elided} { # Must not crash pack [text .tt] - update + updateText .tt insert 0.0 HELLO - update + updateText .tt tag configure HIDE -elide 1 - update + updateText .tt tag add HIDE 0.0 end - update ; update ; update ; update + updateText destroy .tt } {} test textDisp-32.2 {elide and tags} { @@ -4054,10 +4074,11 @@ test textDisp-32.2 {elide and tags} { {testtag1 testtag3} \ {[this bit here uses tags 2 and 3]} \ {testtag2 testtag3} - update + updateText # indent left margin of tag 1 by 20 pixels # text should be indented - .tt tag configure testtag1 -lmargin1 20 ; update + .tt tag configure testtag1 -lmargin1 20 + updateText #1 set res {} lappend res [list [.tt index "1.0 + 0 displaychars"] \ @@ -4065,7 +4086,8 @@ test textDisp-32.2 {elide and tags} { [lindex [.tt bbox "1.0 + 0 displaychars"] 0]] # hide tag 1, remaining text should not be indented, since # the indented tag and character is hidden. - .tt tag configure testtag1 -elide 1 ; update + .tt tag configure testtag1 -elide 1 + updateText #2 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4075,7 +4097,8 @@ test textDisp-32.2 {elide and tags} { .tt tag configure testtag1 -elide 0 # 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 ; update + .tt tag configure testtag2 -lmargin1 20 + updateText #3 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4083,7 +4106,8 @@ test textDisp-32.2 {elide and tags} { # hide tag 1, remaining text should now be indented, but # 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 ; update + .tt tag configure testtag1 -elide 1 + updateText #4 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4095,7 +4119,8 @@ test textDisp-32.2 {elide and tags} { # text should be indented, since this tag takes # precedence over testtag1, and is applied to the # start of the text. - .tt tag configure testtag3 -lmargin1 20 ; update + .tt tag configure testtag3 -lmargin1 20 + updateText #5 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4103,7 +4128,8 @@ test textDisp-32.2 {elide and tags} { # hide tag 1, remaining text should still be indented, # since it still has testtag3 on it. Again the # bbox of 1.0 should have 0. - .tt tag configure testtag1 -elide 1 ; update + .tt tag configure testtag1 -elide 1 + updateText #6 lappend res [list [.tt index "1.0 + 0 displaychars"] \ [lindex [.tt bbox 1.0] 0] \ @@ -4141,7 +4167,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup { .tt insert end ":)" emoticon .tt image create end -image $img pack .tt - update; update; update + updateText } -cleanup { image delete $img destroy .tt @@ -4150,7 +4176,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup { test textDisp-33.0 {one line longer than fits in the widget} { pack [text .tt -wrap char] .tt insert 1.0 [string repeat "more wrap + " 300] - update ; update ; update + updateText .tt see 1.0 lindex [.tt yview] 0 } {0.0} @@ -4158,7 +4184,7 @@ test textDisp-33.1 {one line longer than fits in the widget} { destroy .tt pack [text .tt -wrap char] .tt insert 1.0 [string repeat "more wrap + " 300] - update ; update ; update + updateText .tt yview "1.0 +1 displaylines" if {[lindex [.tt yview] 0] > 0.1} { set result "window should be scrolled to the top" @@ -4182,7 +4208,9 @@ test textDisp-33.3 {one line longer than fits in the widget} { .tt debug 1 set tk_textHeightCalc "" .tt insert 1.0 [string repeat "more wrap + " 300] - update ; .tt count -update -ypixels 1.0 end ; update + updateText + .tt count -update -ypixels 1.0 end + updateText # Each line should have been recalculated just once .tt debug 0 expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]} @@ -4193,7 +4221,7 @@ test textDisp-33.4 {one line longer than fits in the widget} { .tt debug 1 set tk_textHeightCalc "" .tt insert 1.0 [string repeat "more wrap + " 300] - update ; update ; update + updateText set idx [.tt index "1.0 + 1 displaylines"] .tt yview $idx if {[lindex [.tt yview] 0] > 0.1} { @@ -4215,7 +4243,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 - update + updateText set bb {} for {set i 0} {$i < 12} {incr i 4} { lappend bb [lindex [.tt bbox 1.$i] 0] @@ -4242,7 +4270,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { .t1 debug 1 set ge [winfo geometry .] scan $ge "%dx%d+%d+%d" width height left top - update + updateText .t1 sync set negative 0 bind .t1 <<WidgetViewSync>> { if {%d < 0} {set negative 1} } @@ -4252,7 +4280,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" - update + updateText .t1 sync set negative } -cleanup { diff --git a/tests/textWind.test b/tests/textWind.test index 788c245..938357b 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -960,7 +960,7 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup { place .t -x 30 -y 50 frame .f -width 30 -height 20 -bg $color .t window create 1.12 -window .f - update + update ; after 100 ; update winfo geom .f } -cleanup { destroy .f @@ -980,7 +980,7 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup { place .t -x 30 -y 50 frame .t.f -width 30 -height 20 -bg $color .t window create 1.12 -window .t.f - update + update ; after 100 ; update winfo geom .t.f } -cleanup { destroy .t.f |