summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorculler <culler>2019-10-09 16:14:36 (GMT)
committerculler <culler>2019-10-09 16:14:36 (GMT)
commitacf09c23d7751b29498cb3bf9d5c7f88a83637be (patch)
tree8fc3d1c2cfe4ff88e220fb346e0795529d30733f /tests
parent039617ba140279fe5af76656909a5c6c1c255e30 (diff)
downloadtk-acf09c23d7751b29498cb3bf9d5c7f88a83637be.zip
tk-acf09c23d7751b29498cb3bf9d5c7f88a83637be.tar.gz
tk-acf09c23d7751b29498cb3bf9d5c7f88a83637be.tar.bz2
Clean up the other tests. Mouse movement is still needed to avoid hangs.
Diffstat (limited to 'tests')
-rw-r--r--tests/canvImg.test24
-rw-r--r--tests/event.test2
-rw-r--r--tests/image.test19
-rw-r--r--tests/listbox.test35
-rw-r--r--tests/spinbox.test4
-rw-r--r--tests/textDisp.test771
-rw-r--r--tests/textWind.test8
7 files changed, 449 insertions, 414 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/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..8249eca 100644
--- a/tests/listbox.test
+++ b/tests/listbox.test
@@ -2662,10 +2662,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 +2678,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 +2755,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 +2773,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 +2793,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/spinbox.test b/tests/spinbox.test
index 5a1cffc..1674b37 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -3214,7 +3214,9 @@ test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup {
} -body {
spinbox .e -width 5 -xscrollcommand thisisnotacommand
pack .e
- update
+ vwait errorInfo
+# update idletasks
+# after 100
list $x $errorInfo
} -cleanup {
destroy .e
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 7245e91..45c4bd3 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -77,7 +77,7 @@ wm withdraw .
wm minsize . 1 1
wm positionfrom . user
wm deiconify .
-update
+update idletasks
# 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 +158,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
+ update idletasks
destroy .txt
} {}
@@ -171,7 +171,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
+ update idletasks
destroy .txt
} {}
@@ -185,7 +185,7 @@ test textDisp-0.5 {double tag elide transition} {
.txt insert end "\n" {SYSTEM TRAFFIC}
.txt insert end "\n" WELCOME
# Crash was here.
- update
+ update idletasks
destroy .txt
} {}
@@ -216,7 +216,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
+ update idletasks
set result [list [.t bbox 2.20]]
.t tag add x 2.0 2.1
lappend result [.t bbox 2.20]
@@ -275,7 +275,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
+ update idletasks
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "This isxx some sample text for testing."
@@ -283,7 +283,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
+update idletasks
test textDisp-2.9 {LayoutDLine, marks and tags} {textfonts} {
.t configure -wrap word
.t delete 1.0 end
@@ -535,33 +535,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
+ update idletasks
.t delete 2.0 2.end
- update
+ update idletasks
set res $tk_textRelayout
.t insert 2.0 "New Line 2"
- update
+ update idletasks
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
+ update idletasks
.t mark set x 2.21
.t delete 2.2
- update
+ update idletasks
set res $tk_textRelayout
.t insert 2.0 X
- update
+ update idletasks
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
+ update idletasks
.t mark set x 2.21
.t delete 2.2
- update
+ update idletasks
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 +569,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
+ update idletasks
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 +577,11 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} {
wm overrideredirect . 1
}
wm geom . 103x$height
- update
+ update idletasks
.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
+ update idletasks
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 +601,20 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} {
frame .f2 -width 20 -height 100
pack .f2 -before .f
wm geom . 103x103
- update
+ update idletasks
.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
+ update idletasks
set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout]
wm overrideredirect . 0
- update
+ update idletasks
set x
} [list [list 5 5 1 1] {} 1.0]
catch {destroy .f2}
.t configure -borderwidth 0 -wrap char
wm geom . {}
-update
+update idletasks
set bw [.t cget -borderwidth]
set px [.t cget -padx]
set py [.t cget -pady]
@@ -633,28 +633,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
+ update idletasks
.t yview 16.0
- update
+ update idletasks
set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw]
wm overrideredirect . 0
- update
+ update idletasks
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
+ update idletasks
.t delete 5.0 14.0
- update
+ update idletasks
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
+ update idletasks
.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 +662,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
+ update idletasks
.t delete 13.0 end
- update
+ update idletasks
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
+ update idletasks
.t delete 14.0 end
- update
+ update idletasks
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 +682,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
+ update idletasks
.t yview moveto 0
- update
+ update idletasks
.t yview moveto 1
- update
+ update idletasks
winfo ismapped .b
} {0}
.t configure -wrap word
@@ -699,33 +699,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
+ update idletasks
.t yview scroll 3 units
- update
+ update idletasks
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
+ update idletasks
.t yview scroll 3 units
- update
+ update idletasks
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
+ update idletasks
.t yview scroll -2 units
- update
+ update idletasks
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
+ update idletasks
.t yview scroll -2 units
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0}}
test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {textfonts} {
@@ -733,9 +733,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
+ update idletasks
.t xview scroll 3 units
- update
+ update idletasks
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 +744,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
+ update idletasks
.t xview scroll 100 units
- update
+ update idletasks
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 +754,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
+ update idletasks
.t xview moveto 0
.t xview scroll -10 units
- update
+ update idletasks
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 +767,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
+ update idletasks
.t delete 2.30 2.44
- update
+ update idletasks
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 +778,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
+ update idletasks
.t xview moveto .6
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{} {}}
test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {textfonts} {
@@ -789,7 +789,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
+ update idletasks
.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 +799,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
+ update idletasks
.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 +817,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
+ update idletasks
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 +832,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
+ update idletasks
list [winfo width .t.f] [winfo height .t.f]
} [list 30 30]
@@ -843,9 +843,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
+ update idletasks
.t delete 2.0 3.0
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{2.0 10.0} {2.0 10.0}}
test textDisp-6.2 {scrolling in DisplayText, scroll down} {
@@ -854,9 +854,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
+ update idletasks
.t insert 2.0 "New Line 2\n"
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0}}
test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} {
@@ -866,10 +866,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
+ update idletasks
.t insert 2.end "is so long that it wraps"
.t insert 4.end "is so long that it wraps"
- update
+ update idletasks
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 +879,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
+ update idletasks
.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
+ update idletasks
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 +894,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
+ update idletasks
.t delete 1.6 1.end
- update
+ update idletasks
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 +911,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
+ update idletasks
.t delete 1.6 1.end
destroy .f2
- update
+ update idletasks
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
+ update idletasks
+ .t count -update -ypixels 1.0 end
+ update idletasks
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
+ update idletasks
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
+ update idletasks
+ .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
+ update idletasks
set scrollInfo unchanged
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- update
+ update idletasks
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua} {
@@ -964,9 +967,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
+ update idletasks
.t delete 2.0 3.0
- update
+ update idletasks
list $tk_textEmbWinDisplay
} {{4.0 6.0}}
@@ -984,61 +987,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
+ update idletasks
destroy .f2
- update
+ update idletasks
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
+ update idletasks
destroy .f2
- update
+ update idletasks
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
+ update idletasks
destroy .f2
- update
+ update idletasks
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
+ update idletasks
destroy .f2
- update
+ update idletasks
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
+ update idletasks
destroy .f2
- update
+ update idletasks
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
+ update idletasks
destroy .f2
- update
+ update idletasks
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
+ update idletasks
destroy .f2
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{} {borders 3.0 4.0 5.0}}
test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} {
@@ -1047,9 +1050,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
+ update idletasks
destroy .f2
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{} {borders 4.0 5.0 6.0 7.0 eof}}
.t configure -bd 0
@@ -1061,9 +1064,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
+ update idletasks
.t delete 2.36 2.38
- update
+ update idletasks
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 +1076,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
+ update idletasks
.t insert 1.2 xx
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.3 {TkTextChanged} {
@@ -1084,9 +1087,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
+ update idletasks
.t insert 2.0 xx
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
test textDisp-8.4 {TkTextChanged} {
@@ -1095,9 +1098,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
+ update idletasks
.t delete 1.5
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.5 {TkTextChanged} {
@@ -1106,9 +1109,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
+ update idletasks
.t delete 1.40 1.44
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.6 {TkTextChanged} {
@@ -1117,9 +1120,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
+ update idletasks
.t delete 1.41 1.44
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.7 {TkTextChanged} {
@@ -1128,9 +1131,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
+ update idletasks
.t delete 1.2 1.end
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 9.0 10.0}}
test textDisp-8.8 {TkTextChanged} {
@@ -1139,9 +1142,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
+ update idletasks
.t delete 2.2
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
test textDisp-8.9 {TkTextChanged} {
@@ -1150,9 +1153,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
+ update idletasks
.t delete 2.0 3.0
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{2.0 8.0} {2.0 8.0}}
test textDisp-8.10 {TkTextChanged} {
@@ -1160,21 +1163,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
+ update idletasks
.t delete 2.19
- update
+ update idletasks
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
+ update idletasks
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
+ update idletasks
+ .t count -update -ypixels 1.0 end
+ update idletasks
.t configure -yscrollcommand ""
set scrollInfo
} {0.0 0.625}
@@ -1187,27 +1192,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
+ update idletasks
.t mark set insert 8.0 ; # up one line
- update
+ update idletasks
set res [list $tk_textRedraw]
.t mark set insert 12.2 ; # in the visible text
- update
+ update idletasks
lappend res $tk_textRedraw
.t mark set insert 6.5 ; # in the hidden text
- update
+ update idletasks
lappend res $tk_textRedraw
.t mark set insert 3.5 ; # in the visible text again
- update
+ update idletasks
lappend res $tk_textRedraw
.t mark set insert 3.8 ; # within the same line
- update
+ update idletasks
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
+ update idletasks
.t insert 3.0 ""
.t delete 1.0 2.0
update idletasks
@@ -1217,62 +1222,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
+ update idletasks
.t tag add big 2.2 2.4
- update
+ update idletasks
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
+ update idletasks
.t tag add big 1.2 2.4
- update
+ update idletasks
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
+ update idletasks
.t tag add big 2.2 2.4
- update
+ update idletasks
.t tag remove big 1.0 end
- update
+ update idletasks
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
+ update idletasks
.t tag add big 2.2 2.20
- update
+ update idletasks
.t tag remove big 1.0 end
- update
+ update idletasks
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
+ update idletasks
.t tag add big 2.2 2.end
- update
+ update idletasks
.t tag remove big 1.0 end
- update
+ update idletasks
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
+ update idletasks
.t tag add big 2.2 3.5
- update
+ update idletasks
.t tag remove big 1.0 end
- update
+ update idletasks
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 +1285,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
+ update idletasks
.t tag remove big 2.19
- update
+ update idletasks
set tk_textRedraw
} {2.0 2.20 eof}
test textDisp-9.8 {TkTextRedrawTag} {textfonts} {
@@ -1290,9 +1295,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
+ update idletasks
.t tag add big 2.0 2.5
- update
+ update idletasks
set tk_textRedraw
} {2.0 2.17}
test textDisp-9.9 {TkTextRedrawTag} {textfonts} {
@@ -1300,9 +1305,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
+ update idletasks
.t tag add big 1.5 2.5
- update
+ update idletasks
set tk_textRedraw
} {2.0 2.17}
test textDisp-9.10 {TkTextRedrawTag} {
@@ -1310,10 +1315,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
+ update idletasks
set tk_textRedraw {none}
.t tag add big 1.3 1.5
- update
+ update idletasks
set tk_textRedraw
} {none}
test textDisp-9.11 {TkTextRedrawTag} {
@@ -1321,9 +1326,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
+ update idletasks
.t tag add big 1.0 2.0
- update
+ update idletasks
set tk_textRedraw
} {}
test textDisp-9.12 {TkTextRedrawTag} {
@@ -1334,9 +1339,9 @@ test textDisp-9.12 {TkTextRedrawTag} {
}
.t tag configure hidden -elide true
.t tag add hidden 2.6 3.6
- update
+ update idletasks
.t tag add hidden 3.11 4.6
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {2.0 {2.0 eof}}
test textDisp-9.13 {TkTextRedrawTag} {
@@ -1349,9 +1354,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
+ update idletasks
.t tag configure hidden -elide false
- update
+ update idletasks
list $tk_textRelayout $tk_textRedraw
} {{2.0 6.0 7.0} {2.0 6.0 7.0}}
test textDisp-9.14 {TkTextRedrawTag} {
@@ -1361,7 +1366,7 @@ test textDisp-9.14 {TkTextRedrawTag} {
}
.tnocrash tag configure mytag1 -relief raised
.tnocrash tag configure mytag2 -relief solid
- update
+ update idletasks
proc doit {} {
.tnocrash tag add mytag1 4.0 5.0
.tnocrash tag add mytag2 4.0 5.0
@@ -1383,9 +1388,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
+ update idletasks
.t configure -bg black
- update
+ update idletasks
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 +1404,7 @@ test textDisp-10.2 {TkTextRelayoutWindow} {
.top.t see insert
tkwait visibility .top.t
place .top.t -width 150 -height 100
- update
+ update idletasks
.top.t index @0,0
} {1.0}
catch {destroy .top}
@@ -1409,96 +1414,96 @@ catch {destroy .top}
for {set i 2} {$i <= 200} {incr i} {
.t insert end "\nLine $i"
}
-update
+update idletasks
test textDisp-11.1 {TkTextSetYView} {
.t yview 30.0
- update
+ update idletasks
.t index @0,0
} {30.0}
test textDisp-11.2 {TkTextSetYView} {
.t yview 30.0
- update
+ update idletasks
.t yview 32.0
- update
+ update idletasks
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
test textDisp-11.3 {TkTextSetYView} {
.t yview 30.0
- update
+ update idletasks
.t yview 28.0
- update
+ update idletasks
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
test textDisp-11.4 {TkTextSetYView} {
.t yview 30.0
- update
+ update idletasks
.t yview 31.4
- update
+ update idletasks
list [.t index @0,0] $tk_textRedraw
} {31.0 40.0}
test textDisp-11.5 {TkTextSetYView} {
.t yview 30.0
- update
+ update idletasks
set tk_textRedraw {}
.t yview -pickplace 31.0
- update
+ update idletasks
list [.t index @0,0] $tk_textRedraw
} {30.0 {}}
test textDisp-11.6 {TkTextSetYView} {
.t yview 30.0
- update
+ update idletasks
set tk_textRedraw {}
.t yview -pickplace 28.0
- update
+ update idletasks
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
test textDisp-11.7 {TkTextSetYView} {
.t yview 30.0
- update ; update
+ update idletasks
set tk_textRedraw {}
.t yview -pickplace 26.0
- update
+ update idletasks
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
+ update idletasks
set tk_textRedraw {}
.t yview -pickplace 41.0
- update
+ update idletasks
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
test textDisp-11.9 {TkTextSetYView} {
.t yview 30.0
- update
+ update idletasks
set tk_textRedraw {}
.t yview -pickplace 43.0
- update
+ update idletasks
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
+ update idletasks
set tk_textRedraw {}
.t yview 10000.0
- update
+ update idletasks
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
+ update idletasks
set tk_textRedraw {}
.t yview 197.0
- update
+ update idletasks
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
+ update idletasks
set tk_textRedraw {}
.t see 10.30
- update
+ update idletasks
list [.t index @0,0] $tk_textRedraw
} {2.0 10.20}
.t delete 10.0 11.0
@@ -1512,15 +1517,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
+ update idletasks
scan [wm geometry .top] "%dx%d" w2 h2
wm geometry .top ${w2}x[expr {$h2-2}]
- update
+ update idletasks
.top.t yview 1.0
- update
+ update idletasks
set tk_textRedraw {}
.top.t see 5.0
- update
+ update idletasks
# 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 +1539,29 @@ pack .top.t
for {set i 2} {$i <= 20} {incr i} {
.top.t insert end "\nLine $i"
}
-update
+update idletasks
test textDisp-11.14 {TkTextSetYView, only a few lines visible} {
.top.t yview 5.0
- update
+ update idletasks
.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
+ update idletasks
.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
+ update idletasks
.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
+ update idletasks
.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 +1576,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
+ update idletasks
.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 +1596,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
+ update idletasks
.top.t see 21.0
- update
+ update idletasks
set ind1 [.top.t index @0,0]
.top.t see end
- update
+ update idletasks
.top.t see 17.0
- update
+ update idletasks
set ind2 [.top.t index @0,0]
.top.t see end
- update
+ update idletasks
.top.t see 15.0
- update
+ update idletasks
set ind3 [.top.t index @0,0]
list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}]
} {1 1}
@@ -1626,7 +1631,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
+ update idletasks
.top.t see 1.0
.top.t index @0,[expr {$lineheight - 2}]
} {1.0}
@@ -1636,38 +1641,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
+ update idletasks
.t yview -pickplace 52.0
- update
+ update idletasks
.t index @0,0
} {49.0}
test textDisp-12.2 {MeasureUp} {
.t yview 100.0
- update
+ update idletasks
.t yview -pickplace 53.0
- update
+ update idletasks
.t index @0,0
} {50.0}
test textDisp-12.3 {MeasureUp} {
.t yview 100.0
- update
+ update idletasks
.t yview -pickplace 50.10
- update
+ update idletasks
.t index @0,0
} {45.0}
.t configure -wrap none
test textDisp-12.4 {MeasureUp} {
.t yview 100.0
- update
+ update idletasks
.t yview -pickplace 53.0
- update
+ update idletasks
.t index @0,0
} {48.0}
test textDisp-12.5 {MeasureUp} {
.t yview 100.0
- update
+ update idletasks
.t yview -pickplace 50.10
- update
+ update idletasks
.t index @0,0
} {45.0}
@@ -1690,7 +1695,7 @@ test textDisp-13.3 {TkTextSeeCmd procedure} {
test textDisp-13.4 {TkTextSeeCmd procedure} {
.t xview moveto 0
.t yview moveto 0
- update
+ update idletasks
.t see 4.2
.t index @0,0
} {1.0}
@@ -1698,7 +1703,7 @@ test textDisp-13.5 {TkTextSeeCmd procedure} {
.t configure -wrap char
.t xview moveto 0
.t yview moveto 0
- update
+ update idletasks
.t see 12.1
.t index @0,0
} {3.0}
@@ -1706,7 +1711,7 @@ test textDisp-13.6 {TkTextSeeCmd procedure} {
.t configure -wrap char
.t xview moveto 0
.t yview moveto 0
- update
+ update idletasks
.t see 30.50
set x [.t index @0,0]
.t configure -wrap none
@@ -1717,7 +1722,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
+ update idletasks
.t see 30.50
.t yview 25.0
.t see 30.50
@@ -1734,7 +1739,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
+ update idletasks
.t see 30.50
set x [list [.t bbox 30.50]]
.t see 30.60
@@ -1750,7 +1755,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
+ update idletasks
.t see 30.50
set x [list [.t bbox 30.50]]
.t see 30.60
@@ -1782,13 +1787,13 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} {
}
wm geometry .top2 300x200+0+0
- update
+ update idletasks
.top2.t2 see "1.0 lineend"
- update
+ update idletasks
set ref [.top2.t2 index @0,0]
.top2.t2 insert "1.0 lineend" ç
.top2.t2 see "1.0 lineend"
- update
+ update idletasks
set new [.top2.t2 index @0,0]
set res [.top2.t2 compare $ref == $new]
destroy .top2
@@ -1799,7 +1804,7 @@ wm geom . {}
.t configure -wrap none
test textDisp-14.1 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- update
+ update idletasks
.t insert end xxxxxxxxx\n
.t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
@@ -1809,7 +1814,7 @@ test textDisp-14.1 {TkTextXviewCmd procedure} {
.t configure -wrap char
test textDisp-14.2 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- update
+ update idletasks
.t insert end xxxxxxxxx\n
.t insert end "xxxxx\n"
.t insert end "xxxx"
@@ -1818,7 +1823,7 @@ test textDisp-14.2 {TkTextXviewCmd procedure} {
.t configure -wrap none
test textDisp-14.3 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- update
+ update idletasks
.t insert end xxxxxxxxx\n
.t insert end "xxxxx\n"
.t insert end "xxxx"
@@ -1911,43 +1916,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
+ update idletasks
.t yview scroll -3 units
.t index @0,0
} {42.0}
test textDisp-15.2 {ScrollByLines procedure, scrolling backwards} {
.t yview 51.0
- update
+ update idletasks
.t yview scroll -2 units
.t index @0,0
} {50.20}
test textDisp-15.3 {ScrollByLines procedure, scrolling backwards} {
.t yview 51.0
- update
+ update idletasks
.t yview scroll -4 units
.t index @0,0
} {49.0}
test textDisp-15.4 {ScrollByLines procedure, scrolling backwards} {
.t yview 50.20
- update
+ update idletasks
.t yview scroll -2 units
.t index @0,0
} {49.0}
test textDisp-15.5 {ScrollByLines procedure, scrolling backwards} {
.t yview 50.40
- update
+ update idletasks
.t yview scroll -2 units
.t index @0,0
} {50.0}
test textDisp-15.6 {ScrollByLines procedure, scrolling backwards} {
.t yview 3.2
- update
+ update idletasks
.t yview scroll -5 units
.t index @0,0
} {1.0}
test textDisp-15.7 {ScrollByLines procedure, scrolling forwards} {
.t yview 48.0
- update
+ update idletasks
.t yview scroll 4 units
.t index @0,0
} {50.40}
@@ -1973,7 +1978,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
+ update idletasks
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 +1998,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
+update idletasks
+.t count -update -ypixels 1.0 end
test textDisp-16.1 {TkTextYviewCmd procedure} {
.t yview 21.0
set x [.t yview]
@@ -2014,7 +2020,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
+ update idletasks
.t yview 98
.t index @0,0
} {99.0}
@@ -2069,7 +2075,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
+ update idletasks
.top1.t insert end "1\n2\n3\n4\n5\n6"
.top1.t yview moveto 0.3333
set result [.top1.t yview]
@@ -2090,7 +2096,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
+ update idletasks
.t yview scroll -1 pages
.t index @0,0
} {42.0}
@@ -2099,42 +2105,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
+ update idletasks
.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
+ update idletasks
.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
+ update idletasks
.t yview 50.0
- update
+ update idletasks
.t yview scroll -1 pages
set x [.t index @0,0]
.t configure -height 10
- update
+ update idletasks
set x
} {49.0}
test textDisp-16.26 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t yview 50.0
- update
+ update idletasks
.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
+ update idletasks
.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
+ update idletasks
.t yview scroll 1 page
set res [expr {int([.t index @0,0])}]
if {$fixedDiff > 1} {
@@ -2144,24 +2150,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
+ update idletasks
.t yview 50.0
- update
+ update idletasks
.t yview scroll 1 pages
set x [.t index @0,0]
.t configure -height 10
- update
+ update idletasks
set x
} {51.0}
test textDisp-16.30 {TkTextYviewCmd procedure, "scroll units" option} {
.t yview 45.0
- update
+ update idletasks
.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
+ update idletasks
.t yview scroll 4 units
.t index @0,0
} {151.40}
@@ -2266,7 +2272,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
+ update idletasks
.t index @0,0
} {5.0}
test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} {
@@ -2280,7 +2286,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
+ update idletasks
.t index @0,0
} {5.0}
test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} {
@@ -2291,9 +2297,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
+ update idletasks
.t see [expr {5 + [winfo height .t] / $fixedHeight + 1}].0
- update
+ update idletasks
.t index @0,0
} {2.0}
@@ -2369,7 +2375,7 @@ test textDisp-18.1 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- update
+ update idletasks
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
test textDisp-18.2 {GetXView procedure} {
@@ -2378,13 +2384,13 @@ test textDisp-18.2 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- update
+ update idletasks
set scrollInfo
} {0.0 1.0}
test textDisp-18.3 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
- update
+ update idletasks
set scrollInfo
} {0.0 1.0}
test textDisp-18.4 {GetXView procedure} {
@@ -2393,7 +2399,7 @@ test textDisp-18.4 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxx\n
.t insert end xxxxxxxxxxxxxxxxx
- update
+ update idletasks
set scrollInfo
} {0.0 1.0}
test textDisp-18.5 {GetXView procedure} {
@@ -2403,7 +2409,7 @@ test textDisp-18.5 {GetXView procedure} {
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
.t xview scroll 31 units
- update
+ update idletasks
set scrollInfo
} [list [expr {31.0/55}] [expr {51.0/55}]]
test textDisp-18.6 {GetXView procedure} {
@@ -2414,27 +2420,27 @@ test textDisp-18.6 {GetXView procedure} {
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
.t xview moveto 0
.t xview scroll 31 units
- update
+ update idletasks
set x {}
lappend x $scrollInfo
.t configure -wrap char
- update
+ update idletasks
lappend x $scrollInfo
.t configure -wrap word
- update
+ update idletasks
lappend x $scrollInfo
.t configure -wrap none
- update
+ update idletasks
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
+ update idletasks
set scrollInfo unchanged
.t insert end xxxxxx\n
.t insert end xxx
- update
+ update idletasks
set scrollInfo
} {unchanged}
test textDisp-18.8 {GetXView procedure} {
@@ -2448,10 +2454,10 @@ test textDisp-18.8 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
- update
+ update idletasks
.t delete 1.0 end
.t configure -xscrollcommand scrollError
- update
+ update idletasks
set x
} {{scrolling error} {scrolling error
while executing
@@ -2468,37 +2474,37 @@ catch {rename bogus {}}
test textDisp-19.1 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- update
+ update idletasks
set scrollInfo
} {0.0 1.0}
test textDisp-19.2 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- update
+ update idletasks
set scrollInfo "unchanged"
.t insert 1.0 "Line1\nLine2"
- update
+ update idletasks
set scrollInfo
} {unchanged}
test textDisp-19.3 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- update; after 10 ; update
+ update idletasks
set scrollInfo "unchanged"
.t insert 1.0 "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- update
+ update idletasks
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
+ update idletasks
set scrollInfo "unchanged"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13} {
.t insert end "\nLine $i"
}
- update
+ update idletasks
set scrollInfo
} [list 0.0 [expr {70.0/91}]]
test textDisp-19.5 {GetYView procedure} {
@@ -2509,7 +2515,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
+ update idletasks
set x $scrollInfo
} {0.0 0.625}
test textDisp-19.6 {GetYView procedure} {
@@ -2521,7 +2527,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
+ update idletasks
set x $scrollInfo
} {0.375 1.0}
test textDisp-19.7 {GetYView procedure} {
@@ -2533,7 +2539,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
+ update idletasks
set x $scrollInfo
} {0.125 0.75}
test textDisp-19.8 {GetYView procedure} {
@@ -2545,7 +2551,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
+ update idletasks
.t count -update -ypixels 1.0 end
set x $scrollInfo
} {0.0625 0.6875}
@@ -2557,7 +2563,7 @@ test textDisp-19.9 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t yview 3.0
- update
+ update idletasks
set scrollInfo
} [list [expr {4.0/30}] 0.8]
test textDisp-19.10 {GetYView procedure} {
@@ -2568,7 +2574,7 @@ test textDisp-19.10 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t yview 11.0
- update
+ update idletasks
set scrollInfo
} [list [expr {1.0/3}] 1.0]
test textDisp-19.10.1 {Widget manipulation causes height miscount} {
@@ -2579,7 +2585,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} {
.t insert end "\nLine $i"
}
.t yview 11.0
- update
+ update idletasks
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Line 1"
@@ -2589,7 +2595,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
+ update idletasks
.t count -update -ypixels 1.0 end
set scrollInfo
} {0.5 1.0}
@@ -2603,7 +2609,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
+ update idletasks
.t count -update -ypixels 1.0 end
set scrollInfo
} {0.5 1.0}
@@ -2741,10 +2747,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
+ update idletasks
scan [wm geom .top] %dx%d twidth theight
wm geom .top ${twidth}x[expr {$theight - 3}]
- update
+ update idletasks
.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 +2761,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
+ update idletasks
scan [wm geom .top] %dx%d twidth theight
wm geom .top ${twidth}x[expr {$theight - 3}]
- update
+ update idletasks
.top.t yview
} [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]]
catch {destroy .top}
@@ -2772,13 +2778,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
+ update idletasks
+ .t count -update -ypixels 1.0 end
+ update idletasks
set scrollInfo "unchanged"
.t mark set insert 3.0
.t tag configure x -background red
.t tag add x 1.0 5.0
- update
+ update idletasks
.t tag delete x
set scrollInfo
} {unchanged}
@@ -2791,14 +2798,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
+ update idletasks
.t configure -yscrollcommand scrollError
proc bgerror args {
global x errorInfo errorCode
set x [list $args $errorInfo $errorCode]
}
.t delete 1.0 end
- update
+ update idletasks
rename bgerror {}
.t configure -yscrollcommand scroll
set x
@@ -2820,7 +2827,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
+ update idletasks
+ .t count -update -ypixels 1.0 end
+ update idletasks
set res {}
lappend res \
[.t count -ypixels 1.0 end] \
@@ -2871,7 +2880,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
+ update idletasks
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 +2893,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
+ update idletasks
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 +2985,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
+update idletasks
.t tag add x 50.1
test textDisp-22.1 {TkTextCharBbox} {textfonts} {
.t config -wrap word
@@ -2993,21 +3002,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
+ update idletasks
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
+ update idletasks
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
+ update idletasks
.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 +3024,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
+ update idletasks
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
+update idletasks
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
+ update idletasks
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 +3060,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
+ update idletasks
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 +3074,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
+ update idletasks
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 +3096,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
+ update idletasks
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 +3110,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
+update idletasks
test textDisp-23.1 {TkTextDLineInfo} {textfonts} {
.t config -wrap word
.t yview 48.0
@@ -3110,14 +3119,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
+ update idletasks
.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
+ update idletasks
.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 +3134,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
+ update idletasks
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
+ update idletasks
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
+update idletasks
test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {textfonts} {
.t config -wrap none
.t delete 1.0 end
@@ -3144,7 +3153,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
+ update idletasks
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 +3182,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
+ update idletasks
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 +3190,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
+ update idletasks
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 +3198,7 @@ test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {textfonts} {
.t delete 1.0 end
.t insert 1.0 01234567890123456789\n012345678901234567890
wm geom . {}
- update
+ update idletasks
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 +3206,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
+ update idletasks
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 +3214,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
+ update idletasks
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 +3222,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
+ update idletasks
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 +3230,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
+ update idletasks
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 +3238,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
+ update idletasks
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 +3246,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
+ update idletasks
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 +3254,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
+ update idletasks
set result {}
lappend result [.t bbox 1.21] [.t bbox 2.0]
.t mark set insert 1.21
@@ -3264,7 +3273,7 @@ test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} {textfonts} {
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . {}
- update
+ update idletasks
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 +3281,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
+ update idletasks
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 +3289,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
+ update idletasks
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 +3300,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
+ update idletasks
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 +3311,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
+ update idletasks
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 +3319,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
+ update idletasks
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 +3327,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
+ update idletasks
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 +3345,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
+update idletasks
test textDisp-24.21 {TkTextCharLayoutProc, word breaks} {textfonts} {
.t configure -wrap word
.t delete 1.0 end
@@ -3366,7 +3375,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
+update idletasks
test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} {textfonts} {
.t delete 1.0 end
.t tag configure x -justify center
@@ -3379,7 +3388,7 @@ test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints
pack .tt
} -body {
.tt insert end \t9\n\t99\n\t999
- update
+ update idletasks
list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3]
} -cleanup {
destroy .tt
@@ -3387,7 +3396,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
+update idletasks
test textDisp-25.1 {CharBboxProc procedure, check tab width} {textfonts} {
.t delete 1.0 end
.t insert 1.0 abc\td\tfgh
@@ -3396,7 +3405,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
+update idletasks
test textDisp-26.1 {AdjustForTab procedure, no tabs} {textfonts} {
.t delete 1.0 end
.t insert 1.0 a\tbcdefghij\tc\td
@@ -3519,7 +3528,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
+ update idletasks
lindex [.t bbox 1.5] 0
} {120}
test textDisp-26.13 {AdjustForTab procedure, not enough space} {textfonts} {
@@ -3566,7 +3575,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
+update idletasks
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 +3644,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
+ update idletasks
set res [.t bbox 2.23]
lset res 0 [expr {[lindex $res 0] - $tab}]
set res
@@ -3656,7 +3665,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
+ update idletasks
set res [.t bbox 2.23]
.t configure -tabstyle tabular
lset res 0 [expr {[lindex $res 0] - $tab}]
@@ -3671,17 +3680,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
+ update idletasks
set res [.t bbox 1.20]
# Now, Tk's interpolated tabs should be the same as
# non-interpolated.
.t configure -tabs $precisetab
- update
+ update idletasks
expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]}
} {0}
.t configure -wrap char -tabs {} -width 20
-update
+update idletasks
test textDisp-27.8 {SizeOfTab procedure, right alignment} {textfonts} {
.t delete 1.0 end
.t insert 1.0 a\t\txyzzyabc
@@ -3725,11 +3734,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
+ update idletasks
.t2.t configure -yscrollcommand bizarre_scroll
.t2.t yview 100.0
set result [.t2.t index @0,0]
- update
+ update idletasks
lappend result [.t2.t index @0,0]
} {6.0 1.0}
@@ -3745,7 +3754,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
+ update idletasks
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 +3769,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
+ update idletasks
.t2.t xview scroll 1 unit
- update
+ update idletasks
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 +3785,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
+ update idletasks
.t2.t xview scroll 5 unit
- update
+ update idletasks
.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 +3802,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
+ update idletasks
.t2.t xview scroll 2 unit
- update
+ update idletasks
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 +3819,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
+ update idletasks
.t2.t xview scroll 7 pixels
- update
+ update idletasks
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 +3836,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
+ update idletasks
.t2.t xview scroll 17 pixels
- update
+ update idletasks
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 +3855,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
+ update idletasks
set xv [.t2.t xview]
set xd [expr {[lindex $xv 1] - [lindex $xv 0]}]
.t2.t xview moveto [expr {1.0-$xd}]
@@ -3872,9 +3881,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
+ update idletasks
.t2.t xview scroll 200 units
- update
+ update idletasks
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 +3903,7 @@ test textDisp-30.2 {elidden text joining multiple logical lines} {
catch {destroy .t2}
.t configure -height 1
-update
+update idletasks
test textDisp-31.1 {line embedded window height update} {
set res {}
@@ -3912,7 +3921,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
+ update idletasks
lappend res [.t count -update -ypixels 1.0 end]
.t.f configure -height 10
.t insert 1.0 "abc\n"
@@ -3934,7 +3943,7 @@ test textDisp-31.3 {line update index shifting} {
# have been performed.
set res {}
.t.f configure -height 100
- update
+ update idletasks
lappend res [.t count -update -ypixels 1.0 end]
.t.f configure -height 10
.t insert 1.0 "abc\n"
@@ -3955,7 +3964,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
+ update idletasks
lappend res [.t count -update -ypixels 1.0 end]
textest configure -height 10
lappend res [.t count -ypixels 1.0 end]
@@ -3966,7 +3975,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
+ update idletasks
lappend res [.t count -update -ypixels 1.0 end]
textest configure -height 10
.t insert 1.0 "abc\n"
@@ -3988,7 +3997,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 +4039,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
+ update idletasks
destroy .tt
} {}
test textDisp-32.1 {everything elided} {
# Must not crash
pack [text .tt]
- update
+ update idletasks
.tt insert 0.0 HELLO
- update
+ update idletasks
.tt tag configure HIDE -elide 1
- update
+ update idletasks
.tt tag add HIDE 0.0 end
- update ; update ; update ; update
+ update idletasks
destroy .tt
} {}
test textDisp-32.2 {elide and tags} {
@@ -4054,10 +4062,11 @@ test textDisp-32.2 {elide and tags} {
{testtag1 testtag3} \
{[this bit here uses tags 2 and 3]} \
{testtag2 testtag3}
- update
+ update idletasks
# 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
+ update idletasks
#1
set res {}
lappend res [list [.tt index "1.0 + 0 displaychars"] \
@@ -4065,7 +4074,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
+ update idletasks
#2
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4075,7 +4085,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
+ update idletasks
#3
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4083,7 +4094,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
+ update idletasks
#4
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4095,7 +4107,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
+ update idletasks
#5
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4103,7 +4116,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
+ update idletasks
#6
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4141,7 +4155,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
+ update idletasks
} -cleanup {
image delete $img
destroy .tt
@@ -4150,7 +4164,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
+ update idletasks
.tt see 1.0
lindex [.tt yview] 0
} {0.0}
@@ -4158,7 +4172,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
+ update idletasks
.tt yview "1.0 +1 displaylines"
if {[lindex [.tt yview] 0] > 0.1} {
set result "window should be scrolled to the top"
@@ -4172,7 +4186,8 @@ test textDisp-33.2 {one line longer than fits in the widget} {
.tt debug 1
set tk_textHeightCalc ""
.tt insert 1.0 [string repeat "more wrap + " 1]
- after 100 ; update idletasks
+ after 100 ;
+ update idletasks
# Nothing should have been recalculated.
set tk_textHeightCalc
} {}
@@ -4182,7 +4197,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
+ update idletasks
+ .tt count -update -ypixels 1.0 end
+ update idletasks
# Each line should have been recalculated just once
.tt debug 0
expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]}
@@ -4193,7 +4210,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
+ update idletasks
set idx [.tt index "1.0 + 1 displaylines"]
.tt yview $idx
if {[lindex [.tt yview] 0] > 0.1} {
@@ -4215,7 +4232,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
+ update idletasks
set bb {}
for {set i 0} {$i < 12} {incr i 4} {
lappend bb [lindex [.tt bbox 1.$i] 0]
@@ -4242,7 +4259,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
+ update idletasks
.t1 sync
set negative 0
bind .t1 <<WidgetViewSync>> { if {%d < 0} {set negative 1} }
@@ -4252,7 +4269,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
+ update idletasks
.t1 sync
set negative
} -cleanup {
diff --git a/tests/textWind.test b/tests/textWind.test
index 788c245..f083026 100644
--- a/tests/textWind.test
+++ b/tests/textWind.test
@@ -953,14 +953,14 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup {
place forget .t
pack .t
# Make sure the Text is mapped before we start
- update
+ update idletasks
} -body {
.t insert 1.0 "Some sample text"
pack forget .t
place .t -x 30 -y 50
frame .f -width 30 -height 20 -bg $color
.t window create 1.12 -window .f
- update
+ update idletasks ; after 100 ; update idletasks
winfo geom .f
} -cleanup {
destroy .f
@@ -973,14 +973,14 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup {
place forget .t
pack .t
# Make sure the Text is mapped before we start
- update
+ update idletasks
} -body {
.t insert 1.0 "Some sample text"
pack forget .t
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 idletasks ; after 100 ; update idletasks
winfo geom .t.f
} -cleanup {
destroy .t.f