diff options
Diffstat (limited to 'tests/bind.test')
-rw-r--r-- | tests/bind.test | 444 |
1 files changed, 283 insertions, 161 deletions
diff --git a/tests/bind.test b/tests/bind.test index adc628a..b84f777 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -2,9 +2,9 @@ # commands plus the procedures in tkBind.c. It is organized in the # standard fashion for Tcl tests. # -# Copyright (c) 1994 The Regents of the University of California. -# Copyright (c) 1994-1995 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. +# Copyright © 1994 The Regents of the University of California. +# Copyright © 1994-1995 Sun Microsystems, Inc. +# Copyright © 1998-1999 by Scriptics Corporation. # All rights reserved. package require tcltest 2.2 @@ -13,6 +13,9 @@ eval tcltest::configure $argv tcltest::loadTestedCommands tk useinputmethods 0 +testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}] + + toplevel .t -width 100 -height 50 wm geom .t +0+0 update idletasks @@ -971,7 +974,7 @@ test bind-13.35 {Tk_BindEvent procedure: execute binding} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-13.38 {Tk_BindEvent procedure: binding gets to run} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1054,7 +1057,7 @@ test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.2 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1072,7 +1075,7 @@ test bind-15.2 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.3 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1087,7 +1090,7 @@ test bind-15.3 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.4 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1103,7 +1106,7 @@ test bind-15.4 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.5 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1119,7 +1122,7 @@ test bind-15.5 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.6 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1136,7 +1139,7 @@ test bind-15.6 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.7 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1153,7 +1156,7 @@ test bind-15.7 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.8 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1168,7 +1171,7 @@ test bind-15.8 {MatchPatterns procedure, ignoring type mismatches} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.9 {MatchPatterns procedure, modifier checks} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1181,7 +1184,7 @@ test bind-15.9 {MatchPatterns procedure, modifier checks} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.10 {MatchPatterns procedure, modifier checks} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1194,7 +1197,7 @@ test bind-15.10 {MatchPatterns procedure, modifier checks} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.11 {MatchPatterns procedure, modifier checks} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1207,7 +1210,7 @@ test bind-15.11 {MatchPatterns procedure, modifier checks} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.12 {MatchPatterns procedure, ignore modifier presses and releases} -constraints { nonPortable } -setup { @@ -1226,7 +1229,7 @@ test bind-15.12 {MatchPatterns procedure, ignore modifier presses and releases} return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.13 {MatchPatterns procedure, checking detail} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1240,7 +1243,7 @@ test bind-15.13 {MatchPatterns procedure, checking detail} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.14 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1257,7 +1260,7 @@ test bind-15.14 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.15 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1274,7 +1277,7 @@ test bind-15.15 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.16 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1291,7 +1294,7 @@ test bind-15.16 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.17 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1308,7 +1311,7 @@ test bind-15.17 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.18 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1325,7 +1328,7 @@ test bind-15.18 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.19 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1342,7 +1345,7 @@ test bind-15.19 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.20 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1359,7 +1362,7 @@ test bind-15.20 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.21 {MatchPatterns procedure, checking "nearby"} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1376,7 +1379,7 @@ test bind-15.21 {MatchPatterns procedure, checking "nearby"} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.22 {MatchPatterns procedure, time wrap-around} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1391,7 +1394,7 @@ test bind-15.22 {MatchPatterns procedure, time wrap-around} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.23 {MatchPatterns procedure, time wrap-around} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1406,7 +1409,7 @@ test bind-15.23 {MatchPatterns procedure, time wrap-around} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.24 {MatchPatterns procedure, virtual event} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1479,7 +1482,7 @@ test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1493,7 +1496,7 @@ test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup { return $x } -cleanup { destroy .t.f -} -result {0} +} -result 0 test bind-15.29 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1525,7 +1528,7 @@ test bind-15.30 {MatchPatterns procedure, conflict resolution} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.31 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1539,7 +1542,7 @@ test bind-15.31 {MatchPatterns procedure, conflict resolution} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.32 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1553,7 +1556,7 @@ test bind-15.32 {MatchPatterns procedure, conflict resolution} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-15.33 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1601,7 +1604,7 @@ test bind-16.2 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {1234} +} -result 1234 test bind-16.3 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1628,7 +1631,7 @@ test bind-16.4 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {3} +} -result 3 test bind-16.5 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1641,7 +1644,7 @@ test bind-16.5 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {47} +} -result 47 test bind-16.6 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1745,7 +1748,7 @@ test bind-16.13 {ExpandPercents procedure} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-16.14 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1784,7 +1787,7 @@ test bind-16.16 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {146} +} -result 146 test bind-16.17 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1850,7 +1853,7 @@ test bind-16.21 {ExpandPercents procedure} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-16.22 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1863,7 +1866,7 @@ test bind-16.22 {ExpandPercents procedure} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-16.23 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1876,7 +1879,7 @@ test bind-16.23 {ExpandPercents procedure} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-16.24 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1916,7 +1919,7 @@ test bind-16.26 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {1402} +} -result 1402 test bind-16.27 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1929,7 +1932,7 @@ test bind-16.27 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {1023} +} -result 1023 test bind-16.28 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -1982,7 +1985,7 @@ test bind-16.31 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {4294} +} -result 4294 test bind-16.32 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2048,7 +2051,7 @@ test bind-16.35 {ExpandPercents procedure} -constraints { set x } -cleanup { destroy .t.f -} -result {a A { } {\r} {{}} {{}} { } {\$} \\\{ {{}} {{}} \u00e9} +} -result {a A { } {\r} {{}} {{}} { } {\$} \\\{ {{}} {{}} \xE9} test bind-16.36 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2061,7 +2064,7 @@ test bind-16.36 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {24} +} -result 24 test bind-16.37 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2074,7 +2077,7 @@ test bind-16.37 {ExpandPercents procedure} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-16.38 {ExpandPercents procedure} -constraints { nonPortable } -setup { @@ -2109,7 +2112,7 @@ test bind-16.39 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {32} +} -result 32 test bind-16.40 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2135,7 +2138,7 @@ test bind-16.41 {ExpandPercents procedure} -setup { set x } -cleanup { destroy .t.f -} -result {2} +} -result 2 test bind-16.42 {ExpandPercents procedure} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2321,7 +2324,7 @@ test bind-17.16 {event command: generate} -setup { set x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-17.17 {event command: generate} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2463,7 +2466,7 @@ test bind-19.11 {DeleteVirtualEvent procedure: owned by 1, only} -setup { set x } -cleanup { destroy .t.f -} -result {101} +} -result 101 test bind-19.12 {DeleteVirtualEvent procedure: owned by 1, first in chain} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2801,7 +2804,7 @@ test bind-22.11 {HandleEventGenerate} -setup { set x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.12 {HandleEventGenerate} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2814,7 +2817,7 @@ test bind-22.12 {HandleEventGenerate} -setup { set x } -cleanup { destroy .t.f -} -result {4} +} -result 4 test bind-22.13 {HandleEventGenerate} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2828,7 +2831,7 @@ test bind-22.13 {HandleEventGenerate} -setup { set x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.14 {HandleEventGenerate} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2984,7 +2987,7 @@ test bind-22.25 {HandleEventGenerate: options <Configure> -borderwidth 2i} -setu expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.26 {HandleEventGenerate: options <Key> -borderwidth 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3078,7 +3081,7 @@ test bind-22.32 {HandleEventGenerate: options <Expose> -count 20} -setup { return $x } -cleanup { destroy .t.f -} -result {20} +} -result 20 test bind-22.33 {HandleEventGenerate: options <Key> -count 20} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3186,7 +3189,7 @@ test bind-22.39 {HandleEventGenerate: options <Enter> -focus 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.40 {HandleEventGenerate: options <Key> -focus 1} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3226,7 +3229,7 @@ test bind-22.42 {HandleEventGenerate: options <Expose> -height 2i} -setup { expr {$x eq [winfo pixels .t.f 2i]} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.43 {HandleEventGenerate: options <Configure> -height 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3240,7 +3243,7 @@ test bind-22.43 {HandleEventGenerate: options <Configure> -height 2i} -setup { expr {$x eq [winfo pixels .t.f 2i]} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.44 {HandleEventGenerate: options <Key> -height 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3280,7 +3283,7 @@ test bind-22.46 {HandleEventGenerate: options <Key> -keycode 20} -setup { return $x } -cleanup { destroy .t.f -} -result {20} +} -result 20 test bind-22.47 {HandleEventGenerate: options <Button> -keycode 20} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3413,7 +3416,7 @@ test bind-22.56 {HandleEventGenerate: options <Map> -override 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.57 {HandleEventGenerate: options <Reparent> -override 1} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3427,7 +3430,7 @@ test bind-22.57 {HandleEventGenerate: options <Reparent> -override 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.58 {HandleEventGenerate: options <Configure> -override 1} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3441,7 +3444,7 @@ test bind-22.58 {HandleEventGenerate: options <Configure> -override 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.59 {HandleEventGenerate: options <Key> -override 1} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3521,7 +3524,7 @@ test bind-22.64 {HandleEventGenerate: options <Key> -root .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.65 {HandleEventGenerate: options <Key> -root xyz} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3548,7 +3551,7 @@ test bind-22.66 {HandleEventGenerate: options <Key> -root [winfo id .t]} -setup expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.67 {HandleEventGenerate: options <Button> -root .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3562,7 +3565,7 @@ test bind-22.67 {HandleEventGenerate: options <Button> -root .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.68 {HandleEventGenerate: options <ButtonRelease> -root .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3576,7 +3579,7 @@ test bind-22.68 {HandleEventGenerate: options <ButtonRelease> -root .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.69 {HandleEventGenerate: options <Motion> -root .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3590,7 +3593,7 @@ test bind-22.69 {HandleEventGenerate: options <Motion> -root .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.70 {HandleEventGenerate: options <<Paste>> -root .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3604,7 +3607,7 @@ test bind-22.70 {HandleEventGenerate: options <<Paste>> -root .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.71 {HandleEventGenerate: options <Enter> -root .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3618,7 +3621,7 @@ test bind-22.71 {HandleEventGenerate: options <Enter> -root .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.72 {HandleEventGenerate: options <Configure> -root .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3658,7 +3661,7 @@ test bind-22.74 {HandleEventGenerate: options <Key> -rootx 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.75 {HandleEventGenerate: options <Button> -rootx 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3672,7 +3675,7 @@ test bind-22.75 {HandleEventGenerate: options <Button> -rootx 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.76 {HandleEventGenerate: options <ButtonRelease> -rootx 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3686,7 +3689,7 @@ test bind-22.76 {HandleEventGenerate: options <ButtonRelease> -rootx 2i} -setup expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.77 {HandleEventGenerate: options <Motion> -rootx 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3700,7 +3703,7 @@ test bind-22.77 {HandleEventGenerate: options <Motion> -rootx 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.78 {HandleEventGenerate: options <<Paste>> -rootx 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3714,7 +3717,7 @@ test bind-22.78 {HandleEventGenerate: options <<Paste>> -rootx 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.79 {HandleEventGenerate: options <Enter> -rootx 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3728,7 +3731,7 @@ test bind-22.79 {HandleEventGenerate: options <Enter> -rootx 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.80 {HandleEventGenerate: options <Configure> -rootx 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3768,7 +3771,7 @@ test bind-22.82 {HandleEventGenerate: options <Key> -rooty 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.83 {HandleEventGenerate: options <Button> -rooty 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3782,7 +3785,7 @@ test bind-22.83 {HandleEventGenerate: options <Button> -rooty 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.84 {HandleEventGenerate: options <ButtonRelease> -rooty 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3796,7 +3799,7 @@ test bind-22.84 {HandleEventGenerate: options <ButtonRelease> -rooty 2i} -setup expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.85 {HandleEventGenerate: options <Motion> -rooty 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3810,7 +3813,7 @@ test bind-22.85 {HandleEventGenerate: options <Motion> -rooty 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.86 {HandleEventGenerate: options <<Paste>> -rooty 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3824,7 +3827,7 @@ test bind-22.86 {HandleEventGenerate: options <<Paste>> -rooty 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.87 {HandleEventGenerate: options <Enter> -rooty 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3838,7 +3841,7 @@ test bind-22.87 {HandleEventGenerate: options <Enter> -rooty 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.88 {HandleEventGenerate: options <Configure> -rooty 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3878,7 +3881,7 @@ test bind-22.90 {HandleEventGenerate: options <Key> -sendevent 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.91 {HandleEventGenerate: options <Key> -sendevent yes} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3892,7 +3895,7 @@ test bind-22.91 {HandleEventGenerate: options <Key> -sendevent yes} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.92 {HandleEventGenerate: options <Key> -sendevent 43} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3906,7 +3909,7 @@ test bind-22.92 {HandleEventGenerate: options <Key> -sendevent 43} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.93 {HandleEventGenerate: options <Key> -serial xyz} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3933,7 +3936,7 @@ test bind-22.94 {HandleEventGenerate: options <Key> -serial 100} -setup { return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.95 {HandleEventGenerate: options <Key> -state xyz} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3960,7 +3963,7 @@ test bind-22.96 {HandleEventGenerate: options <Key> -state 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.97 {HandleEventGenerate: options <Button> -state 1025} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3974,7 +3977,7 @@ test bind-22.97 {HandleEventGenerate: options <Button> -state 1025} -setup { return $x } -cleanup { destroy .t.f -} -result {1025} +} -result 1025 test bind-22.98 {HandleEventGenerate: options <ButtonRelease> -state 1025} -setup { frame .t.f -class Test -width 150 -height 100 @@ -3988,7 +3991,7 @@ test bind-22.98 {HandleEventGenerate: options <ButtonRelease> -state 1025} -setu return $x } -cleanup { destroy .t.f -} -result {1025} +} -result 1025 test bind-22.99 {HandleEventGenerate: options <Motion> -state 1} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4002,7 +4005,7 @@ test bind-22.99 {HandleEventGenerate: options <Motion> -state 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.100 {HandleEventGenerate: options <<Paste>> -state 1} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4016,7 +4019,7 @@ test bind-22.100 {HandleEventGenerate: options <<Paste>> -state 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.101 {HandleEventGenerate: options <Enter> -state 1} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4030,7 +4033,7 @@ test bind-22.101 {HandleEventGenerate: options <Enter> -state 1} -setup { return $x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.102 {HandleEventGenerate: options <Visibility> -state xyz} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4097,7 +4100,7 @@ test bind-22.106 {HandleEventGenerate: options <Key> -subwindow .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.107 {HandleEventGenerate: options <Key> -subwindow xyz} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4124,7 +4127,7 @@ test bind-22.108 {HandleEventGenerate: options <Key> -subwindow [winfo id .t]} - expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.109 {HandleEventGenerate: options <Button> -subwindow .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4138,7 +4141,7 @@ test bind-22.109 {HandleEventGenerate: options <Button> -subwindow .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.110 {HandleEventGenerate: options <ButtonRelease> -subwindow .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4152,7 +4155,7 @@ test bind-22.110 {HandleEventGenerate: options <ButtonRelease> -subwindow .t} -s expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.111 {HandleEventGenerate: options <Motion> -subwindow .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4166,7 +4169,7 @@ test bind-22.111 {HandleEventGenerate: options <Motion> -subwindow .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.112 {HandleEventGenerate: options <<Paste>> -subwindow .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4180,7 +4183,7 @@ test bind-22.112 {HandleEventGenerate: options <<Paste>> -subwindow .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.113 {HandleEventGenerate: options <Enter> -subwindow .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4194,7 +4197,7 @@ test bind-22.113 {HandleEventGenerate: options <Enter> -subwindow .t} -setup { expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.114 {HandleEventGenerate: options <Configure> -subwindow .t} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4234,7 +4237,7 @@ test bind-22.116 {HandleEventGenerate: options <Key> -time 100} -setup { return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.117 {HandleEventGenerate: options <Button> -time 100} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4248,7 +4251,7 @@ test bind-22.117 {HandleEventGenerate: options <Button> -time 100} -setup { return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.118 {HandleEventGenerate: options <ButtonRelease> -time 100} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4262,7 +4265,7 @@ test bind-22.118 {HandleEventGenerate: options <ButtonRelease> -time 100} -setup return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.119 {HandleEventGenerate: options <Motion> -time 100} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4276,7 +4279,7 @@ test bind-22.119 {HandleEventGenerate: options <Motion> -time 100} -setup { return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.120 {HandleEventGenerate: options <<Paste>> -time 100} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4290,7 +4293,7 @@ test bind-22.120 {HandleEventGenerate: options <<Paste>> -time 100} -setup { return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.121 {HandleEventGenerate: options <Enter> -time 100} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4304,7 +4307,7 @@ test bind-22.121 {HandleEventGenerate: options <Enter> -time 100} -setup { return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.122 {HandleEventGenerate: options <Property> -time 100} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4318,7 +4321,7 @@ test bind-22.122 {HandleEventGenerate: options <Property> -time 100} -setup { return $x } -cleanup { destroy .t.f -} -result {100} +} -result 100 test bind-22.123 {HandleEventGenerate: options <Configure> -time 100} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4358,7 +4361,7 @@ test bind-22.125 {HandleEventGenerate: options <Expose> -width 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.126 {HandleEventGenerate: options <Configure> -width 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4372,7 +4375,7 @@ test bind-22.126 {HandleEventGenerate: options <Configure> -width 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.127 {HandleEventGenerate: options <Key> -width 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4563,7 +4566,7 @@ test bind-22.140 {HandleEventGenerate: options <Key> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.141 {HandleEventGenerate: options <Button> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4577,7 +4580,7 @@ test bind-22.141 {HandleEventGenerate: options <Button> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.142 {HandleEventGenerate: options <ButtonRelease> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4591,7 +4594,7 @@ test bind-22.142 {HandleEventGenerate: options <ButtonRelease> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.143 {HandleEventGenerate: options <Motion> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4605,7 +4608,7 @@ test bind-22.143 {HandleEventGenerate: options <Motion> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.144 {HandleEventGenerate: options <<Paste>> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4619,7 +4622,7 @@ test bind-22.144 {HandleEventGenerate: options <<Paste>> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.145 {HandleEventGenerate: options <Enter> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4633,7 +4636,7 @@ test bind-22.145 {HandleEventGenerate: options <Enter> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.146 {HandleEventGenerate: options <Expose> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4647,7 +4650,7 @@ test bind-22.146 {HandleEventGenerate: options <Expose> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.147 {HandleEventGenerate: options <Configure> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4661,7 +4664,7 @@ test bind-22.147 {HandleEventGenerate: options <Configure> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.148 {HandleEventGenerate: options <Gravity> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4675,7 +4678,7 @@ test bind-22.148 {HandleEventGenerate: options <Gravity> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.149 {HandleEventGenerate: options <Reparent> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4689,7 +4692,7 @@ test bind-22.149 {HandleEventGenerate: options <Reparent> -x 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.150 {HandleEventGenerate: options <Map> -x 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4729,7 +4732,7 @@ test bind-22.152 {HandleEventGenerate: options <Key> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.153 {HandleEventGenerate: options <Button> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4743,7 +4746,7 @@ test bind-22.153 {HandleEventGenerate: options <Button> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.154 {HandleEventGenerate: options <ButtonRelease> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4757,7 +4760,7 @@ test bind-22.154 {HandleEventGenerate: options <ButtonRelease> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.155 {HandleEventGenerate: options <Motion> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4771,7 +4774,7 @@ test bind-22.155 {HandleEventGenerate: options <Motion> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.156 {HandleEventGenerate: options <<Paste>> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4785,7 +4788,7 @@ test bind-22.156 {HandleEventGenerate: options <<Paste>> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.157 {HandleEventGenerate: options <Enter> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4799,7 +4802,7 @@ test bind-22.157 {HandleEventGenerate: options <Enter> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.158 {HandleEventGenerate: options <Expose> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4813,7 +4816,7 @@ test bind-22.158 {HandleEventGenerate: options <Expose> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.159 {HandleEventGenerate: options <Configure> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4827,7 +4830,7 @@ test bind-22.159 {HandleEventGenerate: options <Configure> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.160 {HandleEventGenerate: options <Gravity> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4841,7 +4844,7 @@ test bind-22.160 {HandleEventGenerate: options <Gravity> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.161 {HandleEventGenerate: options <Reparent> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -4855,7 +4858,7 @@ test bind-22.161 {HandleEventGenerate: options <Reparent> -y 2i} -setup { expr {[winfo pixels .t.f 2i] eq $x} } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-22.162 {HandleEventGenerate: options <Map> -y 2i} -setup { frame .t.f -class Test -width 150 -height 100 @@ -5541,13 +5544,13 @@ test bind-26.6 {event names: ButtonPress} -setup { focus -force .t.f update } -body { - bind .t.f <ButtonPress> "set x {event ButtonPress}" + bind .t.f <Button> "set x {event Button}" set x xyzzy - event generate .t.f <ButtonPress> + event generate .t.f <Button> list $x [bind .t.f] } -cleanup { destroy .t.f -} -result {{event ButtonPress} <Button>} +} -result {{event Button} <Button>} test bind-26.7 {event names: ButtonRelease} -setup { frame .t.f -class Test -width 150 -height 100 @@ -5639,9 +5642,9 @@ test bind-26.13 {event names: KeyPress} -setup { focus -force .t.f update } -body { - bind .t.f <KeyPress> "set x {event KeyPress}" + bind .t.f <Key> "set x {event KeyPress}" set x xyzzy - event generate .t.f <KeyPress> + event generate .t.f <Key> list $x [bind .t.f] } -cleanup { destroy .t.f @@ -6017,7 +6020,7 @@ test bind-28.9 {keysym names, Eth -> ETH} -body { } -cleanup { destroy .t.f } -result {<Key-ETH>} -test bind-28.10 {keysym names, Ooblique -> Oslash} -body { +test bind-28.10 {keysym names, Ooblique -> Oslash} -constraints nodeprecated -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <Ooblique> foo bind .t.f @@ -6118,7 +6121,7 @@ test bind-30.2 {MouseWheel events} -setup { set x } -cleanup { destroy .t.f -} -result {120} +} -result 120 test bind-30.3 {MouseWheel events} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -6229,6 +6232,8 @@ test bind-31.7 {virtual event user_data field - unshared, asynch} -setup { } -result {{} {} {TestUserData >b<}} test bind-32.1 {-warp, window was destroyed before the idle callback DoWarp} -setup { + # note: this test is now essentially useless + # since DoWarp no longer exist, not even as an idle callback frame .t.f pack .t.f focus -force .t.f @@ -6414,7 +6419,7 @@ test bind-32.12 {don't detect repetition when window has changed} -setup { } -cleanup { destroy .t.f destroy .t.g -} -result {1} +} -result 1 test bind-32.13 {don't detect repetition when window has changed} -setup { pack [frame .t.f] pack [frame .t.g] @@ -6446,7 +6451,7 @@ test bind-32.14 {don't detect repetition when window has changed} -setup { } -cleanup { destroy .t.f destroy .t.g -} -result {1} +} -result 1 test bind-32.15 {reset button state when destroying window} -setup { set x {} } -body { @@ -6461,7 +6466,7 @@ test bind-32.15 {reset button state when destroying window} -setup { event generate .t.f <Button-1> destroy .t.f set x -} -result {1} +} -result 1 test bind-33.1 {prefer longest match} -setup { pack [frame .t.f] @@ -6521,7 +6526,7 @@ test bind-33.4 {prefer most specific event} -setup { set x } -cleanup { destroy .t.f -} -result {11} +} -result 11 test bind-33.5 {prefer most specific event} -setup { pack [frame .t.f] focus -force .t.f @@ -6535,7 +6540,7 @@ test bind-33.5 {prefer most specific event} -setup { set x } -cleanup { destroy .t.f -} -result {11} +} -result 11 test bind-33.6 {prefer most specific event} -setup { pack [frame .t.f] focus -force .t.f @@ -6553,7 +6558,7 @@ test bind-33.6 {prefer most specific event} -setup { set x } -cleanup { destroy .t.f -} -result {1111} +} -result 1111 test bind-33.7 {prefer most specific event} -setup { pack [frame .t.f] focus -force .t.f @@ -6567,7 +6572,7 @@ test bind-33.7 {prefer most specific event} -setup { set x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-33.8 {prefer most specific event} -setup { pack [frame .t.f] focus -force .t.f @@ -6582,7 +6587,7 @@ test bind-33.8 {prefer most specific event} -setup { set x } -cleanup { destroy .t.f -} -result {1} +} -result 1 test bind-33.9 {prefer last in case of homogeneous equal patterns} -setup { pack [frame .t.f] focus -force .t.f @@ -6704,6 +6709,104 @@ test bind-33.15 {prefer last in case of homogeneous equal patterns} -setup { # because both bindings are homogeneous equal, so the most recently defined # must be preferred. } -result {last} +test bind-33.16 {simulate use of the keyboard to trigger a pattern sequence with modifier - bug [16ef161925]} -setup { + pack [frame .t.f] + focus -force .t.f + update + set x {} +} -body { + bind .t.f <Escape><Control-c> { lappend x "Esc_Control-c" } + event generate .t.f <Escape> + event generate .t.f <Control_L> + event generate .t.f <Control_L> + event generate .t.f <Control_L> + event generate .t.f <Control-c> + set x +} -cleanup { + destroy .t.f +} -result {Esc_Control-c} +test bind-33.17 {simulate use of the keyboard to trigger a pattern sequence with modifier - bug [16ef161925]} -setup { + pack [frame .t.f] + focus -force .t.f + update + set x {} +} -body { + bind .t.f <Escape><Control-c> { lappend x "Esc_Control-c" } + bind .t.f <Escape><Control_L><Control-c> { lappend x "Esc_Ctrl_L_Control-c" } + event generate .t.f <Escape> + event generate .t.f <Control_L> + event generate .t.f <Control_L> + event generate .t.f <Control_L> + event generate .t.f <Control-c> + set x +} -cleanup { + destroy .t.f +} -result {Esc_Ctrl_L_Control-c} +test bind-33.18 {simulate use of the keyboard to trigger a pattern sequence with modifier - bug [16ef161925]} -setup { + pack [frame .t.f] + focus -force .t.f + update + set x {} +} -body { + bind .t.f <Escape><Control-c> { lappend x "Esc_Control-c" } + bind .t.f <Escape><Control_L><Control-c> { lappend x "Esc_Ctrl_L_Control-c" } + bind .t.f <Escape><Control_L><Control_L><Control-c> { lappend x "Esc_Ctrl_L(2)_Control-c" } + event generate .t.f <Escape> + event generate .t.f <Control_L> + event generate .t.f <Control_L> + event generate .t.f <Control_L> + event generate .t.f <Control-c> + set x +} -cleanup { + destroy .t.f +} -result {Esc_Ctrl_L(2)_Control-c} +test bind-33.19 {simulate use of the keyboard to trigger a pattern sequence with modifier - bug [16ef161925]} -setup { + pack [frame .t.f] + focus -force .t.f + update + set x {} +} -body { + bind .t.f <Escape><Control-c> { lappend x "Esc_Control-c" } + bind .t.f <Escape><Key><Key><Control-c> { lappend x "Esc_Key(2)_Control-c" } + event generate .t.f <Escape> + event generate .t.f <Alt_L> + event generate .t.f <Control_L> + event generate .t.f <Control-c> + set x +} -cleanup { + destroy .t.f +} -result {Esc_Key(2)_Control-c} +test bind-33.20 {simulate use of the keyboard to trigger a pattern sequence with mixed Key and Button types - bug [16ef161925]} -setup { + pack [frame .t.f] + focus -force .t.f + update + set x {} +} -body { + bind .t.f <Key-1><Button-1> { lappend x "1_Button1" } + event generate .t.f <Key-1> + event generate .t.f <KeyRelease-1> + event generate .t.f <Button-1> + set x +} -cleanup { + destroy .t.f +} -result {1_Button1} +test bind-33.21 {simulate use of the keyboard to trigger a pattern sequence with mixed Key and Button types - bug [16ef161925]} -setup { + pack [frame .t.f] + focus -force .t.f + update + set x {} +} -body { + bind .t.f <Key-1><Button-1> { lappend x "1_Button1" } + bind .t.f <Key-1><Button-1><Key-2> { lappend x "1_Button1_2" } + event generate .t.f <Key-1> + event generate .t.f <KeyRelease-1> + event generate .t.f <Button-1> + event generate .t.f <Key-2> + event generate .t.f <KeyRelease-2> + set x +} -cleanup { + destroy .t.f +} -result {1_Button1 1_Button1_2} test bind-34.1 {-warp works relatively to a window} -setup { toplevel .top @@ -6717,15 +6820,11 @@ test bind-34.1 {-warp works relatively to a window} -setup { wm geometry .top +200+200 update event generate .top <Motion> -x 20 -y 20 -warp 1 - update idletasks ; # DoWarp is an idle callback - after 50 ; # Win specific - wait for SendInput to be executed - set pointerPos1 [winfo pointerxy .t] + set pointerPos1 [winfo pointerxy .top] wm geometry .top +600+600 update event generate .top <Motion> -x 20 -y 20 -warp 1 - update idletasks ; # DoWarp is an idle callback - after 50 ; # Win specific - wait for SendInput to be executed - set pointerPos2 [winfo pointerxy .t] + set pointerPos2 [winfo pointerxy .top] # from the first warped position to the second one, the mouse # pointer should have moved the same amount as the window moved set res 1 @@ -6737,17 +6836,13 @@ test bind-34.1 {-warp works relatively to a window} -setup { set res } -cleanup { destroy .top -} -result {1} +} -result 1 test bind-34.2 {-warp works relatively to the screen} -setup { } -body { # Contrary to bind-34.1, we're directly checking screen coordinates event generate {} <Motion> -x 20 -y 20 -warp 1 - update idletasks ; # DoWarp is an idle callback - after 50 ; # Win specific - wait for SendInput to be executed set res [winfo pointerxy .] event generate {} <Motion> -x 200 -y 200 -warp 1 - update idletasks ; # DoWarp is an idle callback - after 50 ; # Win specific - wait for SendInput to be executed lappend res {*}[winfo pointerxy .] } -cleanup { } -result {20 20 200 200} @@ -6765,8 +6860,6 @@ test bind-34.3 {-warp works with null or negative coordinates} -setup { set res {} } -body { event generate {} <Motion> -x 0 -y 0 -warp 1 - update idletasks ; # DoWarp is an idle callback - after 50 ; # Win specific - wait for SendInput to be executed foreach dim [winfo pointerxy .] { if {$dim <= $halo} { lappend res ok @@ -6775,9 +6868,7 @@ test bind-34.3 {-warp works with null or negative coordinates} -setup { } } event generate {} <Motion> -x 100 -y 100 -warp 1 - update idletasks ; after 50 event generate {} <Motion> -x -1 -y -1 -warp 1 - update idletasks ; after 50 foreach dim [winfo pointerxy .] { if {$dim <= $halo} { lappend res ok @@ -6795,7 +6886,7 @@ proc testKey {window event type mods} { global keyInfo numericKeysym set keyInfo {} set numericKeysym {} - bind $window <KeyPress> { + bind $window <Key> { set keyInfo [format "%K,0x%%X,0x%%X,%A" %N %k] set numericKeysym %N } @@ -6869,8 +6960,8 @@ test bind-35.1 {Key events agree for entry widgets} -constraints {aqua} -setup { test bind-35.2 {Can bind to function keys} -constraints {aqua} -body { global keyInfo numericKeysym - bind . <KeyPress> {} - bind . <KeyPress> { + bind . <Key> {} + bind . <Key> { lappend keyInfo %K set numericKeysym %N } @@ -6888,7 +6979,7 @@ test bind-35.3 {Events agree for modifier keys} -constraints {aqua} -setup { } -body { global keyInfo numericalKeysym set result {} - bind . <KeyPress> { + bind . <Key> { set keyInfo [format "%K,0x%%X,0x%%X,%A" %N %k] set numericalKeysym [format "0x%x" %N] } @@ -6920,6 +7011,37 @@ test bind-35.3 {Events agree for modifier keys} -constraints {aqua} -setup { } -cleanup { } -result pass +test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup { + event generate {} <Motion> -warp 1 -x 50 -y 50 + toplevel .top + grab release .top + wm geometry .top 200x200+300+300 + label .top.l -height 5 -width 20 -highlightthickness 2 \ + -highlightbackground black -bg yellow -text "My label" + pack .top.l -side bottom + update + # On KDE/Plasma _with_the_Aurorae_theme_ (at least), setting up the toplevel + # and the label will not be finished after the above 'update'. The WM still + # needs some time before the window is fully ready. For me 50 ms is enough, + # but let's wait more (it depends on computer performance). + after 100 ; update +} -body { + grab .top + event generate .top.l <Motion> -warp 1 -x 10 -y 10 + foreach {x1 y1} [winfo pointerxy .top.l] {} + event generate {} <Motion> -warp 1 -x 50 -y 50 + grab release .top + event generate .top.l <Motion> -warp 1 -x 10 -y 10 + foreach {x2 y2} [winfo pointerxy .top.l] {} + # success if the coords are the same with or without the grab, and if they + # are at (10,10) inside the label widget as requested by the warping + expr {$x1==$x2 && $y1==$y2 && $x1==[winfo rootx .top.l]+10 \ + && $y1==[winfo rooty .top.l]+10} +} -cleanup { + destroy .top + unset x1 y1 x2 y2 +} -result 1 + # cleanup cleanupTests return |