summaryrefslogtreecommitdiffstats
path: root/tests/textTag.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/textTag.test')
-rw-r--r--tests/textTag.test39
1 files changed, 28 insertions, 11 deletions
diff --git a/tests/textTag.test b/tests/textTag.test
index 825f3b0..9e5ccdc 100644
--- a/tests/textTag.test
+++ b/tests/textTag.test
@@ -1492,7 +1492,8 @@ set y3 [expr {[lindex $c 1] + [lindex $c 3]/2}]
test textTag-15.1 {TkTextBindProc} -constraints haveCourier12 -setup {
.t tag delete x y
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
bind .t <ButtonRelease> {lappend x up}
.t tag bind x <ButtonRelease> {lappend x x-up}
@@ -1518,7 +1519,8 @@ test textTag-15.1 {TkTextBindProc} -constraints haveCourier12 -setup {
test textTag-15.2 {TkTextBindProc} -constraints haveCourier12 -setup {
.t tag delete x y
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
.t tag bind x <Enter> {lappend x x-enter}
.t tag bind x <ButtonPress> {lappend x x-down}
@@ -1547,7 +1549,8 @@ test textTag-15.2 {TkTextBindProc} -constraints haveCourier12 -setup {
test textTag-15.3 {TkTextBindProc} -constraints haveCourier12 -setup {
.t tag delete x y
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
.t tag bind x <Enter> {lappend x x-enter}
.t tag bind x <Any-ButtonPress-1> {lappend x x-down}
@@ -1583,7 +1586,8 @@ test textTag-16.1 {TkTextPickCurrent procedure} -constraints {
} -setup {
.t tag delete {*}[.t tag names]
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
event gen .t <ButtonRelease-1> -state 0x100 -x $x1 -y $y1
set x [.t index current]
@@ -1606,9 +1610,12 @@ test textTag-16.2 {TkTextPickCurrent procedure} -constraints {
} -setup {
.t tag delete {*}[.t tag names]
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
.t tag configure big -font $bigFont
+ # update needed here to stabilize the test
+ update
event gen .t <ButtonRelease-1> -state 0x100 -x $x1 -y $y1
event gen .t <Motion> -x $x2 -y $y2
set x [.t index current]
@@ -1626,7 +1633,8 @@ test textTag-16.3 {TkTextPickCurrent procedure} -constraints {
.t tag remove $i 1.0 end
}
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
foreach i {a b c d} {
.t tag bind $i <Enter> "lappend x enter-$i"
@@ -1656,7 +1664,8 @@ test textTag-16.4 {TkTextPickCurrent procedure} -constraints {
.t tag remove $i 1.0 end
}
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
foreach i {a b c d} {
.t tag bind $i <Enter> "lappend x enter-$i"
@@ -1685,7 +1694,8 @@ test textTag-16.5 {TkTextPickCurrent procedure} -constraints {
.t tag remove $i 1.0 end
}
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
.t tag configure big -font $bigFont
event gen .t <Motion> -x $x1 -y $y1
@@ -1704,7 +1714,8 @@ test textTag-16.6 {TkTextPickCurrent procedure} -constraints {
.t tag remove $i 1.0 end
}
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
.t tag configure big -font $bigFont
event gen .t <Motion> -x $x1 -y $y1
@@ -1724,7 +1735,8 @@ test textTag-16.7 {TkTextPickCurrent procedure} -constraints {
.t tag remove $i 1.0 end
}
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
.t tag configure big -font $bigFont
.t tag bind a <Enter> {.t tag add big 3.0 3.2}
@@ -1755,7 +1767,8 @@ test textTag-17.1 {insert procedure inserts tags} -setup {
test textTag-18.1 {TkTextPickCurrent tag bindings} -setup {
destroy .t
wm geometry . +200+200 ; update
- event generate {} <Motion> -warp 1 -x 5 -y 5 ; update idletasks ; after 50
+ event generate {} <Motion> -warp 1 -x 5 -y 5
+ controlPointerWarpTiming
} -body {
text .t -width 30 -height 4 -relief sunken -borderwidth 10 \
-highlightthickness 10 -pady 2
@@ -1772,6 +1785,10 @@ test textTag-18.1 {TkTextPickCurrent tag bindings} -setup {
set res {}
# Bindings must not trigger on the widget border, only over
# the actual tagged characters themselves.
+ # Note that we don't need to call controlPointerWarpTiming
+ # in the following six calls because we're not checking that
+ # the mouse pointer has actually moved but rather that the
+ # tag binding mechanism of the text widget correctly triggers.
event gen .t <Motion> -warp 1 -x 0 -y 0 ; update
event gen .t <Motion> -warp 1 -x 10 -y 10 ; update
event gen .t <Motion> -warp 1 -x 25 -y 25 ; update