diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-10-31 12:26:48 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-10-31 12:26:48 (GMT) |
commit | 8bf0f1bae151317e296ee3cc7c43d05e0b46a130 (patch) | |
tree | c75ae6af08a61634ba5b80bbc68360e89973f129 /tests/bind.test | |
parent | ae9ec0f179b4d64a2fc92134c8d909c628e5a86d (diff) | |
download | tk-8bf0f1bae151317e296ee3cc7c43d05e0b46a130.zip tk-8bf0f1bae151317e296ee3cc7c43d05e0b46a130.tar.gz tk-8bf0f1bae151317e296ee3cc7c43d05e0b46a130.tar.bz2 |
Test-case cleanup (all backported form 8.7)
Diffstat (limited to 'tests/bind.test')
-rw-r--r-- | tests/bind.test | 710 |
1 files changed, 355 insertions, 355 deletions
diff --git a/tests/bind.test b/tests/bind.test index f653f3e..e1af2ea 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -307,9 +307,9 @@ test bind-5.1 {Tk_CreateBindingTable procedure} -body { test bind-6.1 {Tk_DeleteBindTable procedure} -body { canvas .t.c - .t.c bind foo <1> {string 1} + .t.c bind foo <Button-1> {string 1} .t.c create rectangle 0 0 100 100 - .t.c bind 1 <2> {string 2} + .t.c bind 1 <Button-2> {string 2} destroy .t.c } -cleanup { destroy .t.c @@ -322,17 +322,17 @@ test bind-7.1 {Tk_CreateBinding procedure: bad binding} -body { } -returnCodes error -result {no event type or button # or keysym} test bind-7.3 {Tk_CreateBinding procedure: append} -body { canvas .t.c - .t.c bind foo <1> "button 1" - .t.c bind foo <1> "+more button 1" - .t.c bind foo <1> + .t.c bind foo <Button-1> "button 1" + .t.c bind foo <Button-1> "+more button 1" + .t.c bind foo <Button-1> } -cleanup { destroy .t.c } -result {button 1 more button 1} test bind-7.4 {Tk_CreateBinding procedure: append to non-existing} -body { canvas .t.c - .t.c bind foo <1> "+button 1" - .t.c bind foo <1> + .t.c bind foo <Button-1> "+button 1" + .t.c bind foo <Button-1> } -cleanup { destroy .t.c } -result {button 1} @@ -366,10 +366,10 @@ test bind-9.3 {Tk_DeleteBinding procedure} -setup { set result {} } -body { frame .t.f -class Test -width 150 -height 100 - foreach i {<1> <Meta-1> <Control-1> <Double-Alt-1>} { + foreach i {<Button-1> <Meta-Button-1> <Control-Button-1> <Double-Alt-Button-1>} { bind .t.f $i "binding for $i" } - foreach i {<Control-1> <Double-Alt-1> <1> <Meta-1>} { + foreach i {<Control-Button-1> <Double-Alt-Button-1> <Button-1> <Meta-Button-1>} { bind .t.f $i {} lappend result [lsort [bind .t.f]] } @@ -403,7 +403,7 @@ test bind-11.1 {Tk_GetAllBindings procedure} -body { } -result {! <<Paste>> <Key-Acircumflex> <Key-Delete> <Key-Linefeed> <Key-Tab> <Key-less> <Key-space> <Meta-Key-a> a \{ ~} test bind-11.2 {Tk_GetAllBindings procedure} -body { frame .t.f - foreach i "<Double-1> <Triple-1> <Meta-Control-a> <Double-Alt-Enter> <1>" { + foreach i "<Double-Button-1> <Triple-Button-1> <Meta-Control-a> <Double-Alt-Enter> <Button-1>" { bind .t.f $i Test } lsort [bind .t.f] @@ -412,7 +412,7 @@ test bind-11.2 {Tk_GetAllBindings procedure} -body { } -result {<Button-1> <Control-Meta-Key-a> <Double-Alt-Enter> <Double-Button-1> <Triple-Button-1>} test bind-11.3 {Tk_GetAllBindings procedure} -body { frame .t.f - foreach i "<Double-Triple-1> abcd a<Leave>b" { + foreach i "<Double-Triple-Button-1> abcd a<Leave>b" { bind .t.f $i Test } lsort [bind .t.f] @@ -427,7 +427,7 @@ test bind-12.1 {Tk_DeleteAllBindings procedure} -body { } -result {} test bind-12.2 {Tk_DeleteAllBindings procedure} -body { frame .t.f -class Test -width 150 -height 100 - foreach i "a b c <Meta-1> <Alt-a> <Control-a>" { + foreach i "a b c <Meta-Button-1> <Alt-a> <Control-a>" { bind .t.f $i x } destroy .t.f @@ -440,8 +440,8 @@ test bind-13.1 {Tk_BindEvent procedure} -setup { update set x {} } -body { - bind Test <KeyPress> {lappend x "%W %K Test KeyPress"} - bind all <KeyPress> {lappend x "%W %K all KeyPress"} + bind Test <Key> {lappend x "%W %K Test KeyPress"} + bind all <Key> {lappend x "%W %K all KeyPress"} bind Test : {lappend x "%W %K Test :"} bind all _ {lappend x "%W %K all _"} bind .t.f : {lappend x "%W %K .t.f :"} @@ -452,8 +452,8 @@ test bind-13.1 {Tk_BindEvent procedure} -setup { return $x } -cleanup { destroy .t.f - bind all <KeyPress> {} - bind Test <KeyPress> {} + bind all <Key> {} + bind Test <Key> {} bind all _ {} bind Test : {} } -result {{.t.f colon .t.f :} {.t.f colon Test :} {.t.f colon all KeyPress} {.t.f plus Test KeyPress} {.t.f plus all KeyPress} {.t.f underscore Test KeyPress} {.t.f underscore all _}} @@ -465,16 +465,16 @@ test bind-13.2 {Tk_BindEvent procedure} -setup { update set x {} } -body { - bind Test <KeyPress> {lappend x "%W %K Test press any"; break} - bind all <KeyPress> {continue; lappend x "%W %K all press any"} + bind Test <Key> {lappend x "%W %K Test press any"; break} + bind all <Key> {continue; lappend x "%W %K all press any"} bind .t.f : {lappend x "%W %K .t.f pressed colon"} event generate .t.f <Key-colon> return $x } -cleanup { destroy .t.f - bind all <KeyPress> {} - bind Test <KeyPress> {} + bind all <Key> {} + bind Test <Key> {} } -result {{.t.f colon .t.f pressed colon} {.t.f colon Test press any}} test bind-13.3 {Tk_BindEvent procedure} -setup { @@ -485,14 +485,14 @@ test bind-13.3 {Tk_BindEvent procedure} -setup { update set x {} } -body { - bind Test <KeyPress> {lappend x "%W %K Test press any"; error Test} + bind Test <Key> {lappend x "%W %K Test press any"; error Test} bind .t.f : {lappend x "%W %K .t.f pressed colon"} event generate .t.f <Key-colon> update list $x $errorInfo } -cleanup { destroy .t.f - bind Test <KeyPress> {} + bind Test <Key> {} rename bgerror {} } -result {{{.t.f colon .t.f pressed colon} {.t.f colon Test press any}} {Test while executing @@ -576,14 +576,14 @@ test bind-13.9 {Tk_BindEvent procedure} -setup { update set x {} } -body { - bind .t.f <1> {lappend x "%W z (.t.f <1> binding)"} - bind .t.f <ButtonPress> {lappend x "%W z (.t.f <ButtonPress> binding)"} + bind .t.f <Button-1> {lappend x "%W z (.t.f <Button-1> binding)"} + bind .t.f <Button> {lappend x "%W z (.t.f <Button> binding)"} event generate .t.f <Button-1> event generate .t.f <Button-2> return $x } -cleanup { destroy .t.f -} -result {{.t.f z (.t.f <1> binding)} {.t.f z (.t.f <ButtonPress> binding)}} +} -result {{.t.f z (.t.f <Button-1> binding)} {.t.f z (.t.f <Button> binding)}} test bind-13.10 {Tk_BindEvent procedure: ignore NotifyInferior} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -946,12 +946,12 @@ test bind-13.33 {Tk_BindEvent procedure: many C bindings cause realloc} -setup { } -body { bindtags .t.f {a b c d e f g h i j k l m n o p} foreach p [bindtags .t.f] { - bind $p <1> "lappend x $p" + bind $p <Button-1> "lappend x $p" } - event generate .t.f <1> + event generate .t.f <Button-1> return $x } -cleanup { - foreach p [bindtags .t.f] {bind $p <1> {}} + foreach p [bindtags .t.f] {bind $p <Button-1> {}} destroy .t.f } -result {a b c d e f g h i j k l m n o p} test bind-13.34 {Tk_BindEvent procedure: multiple tags} -setup { @@ -976,12 +976,12 @@ test bind-13.35 {Tk_BindEvent procedure: execute binding} -setup { update set x {} } -body { - bind .t.f <1> {lappend x 1} - event generate .t.f <1> + bind .t.f <Button-1> {lappend x 1} + event generate .t.f <Button-1> 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 @@ -989,13 +989,13 @@ test bind-13.38 {Tk_BindEvent procedure: binding gets to run} -setup { update set x {} } -body { - bind Test <1> {lappend x Test} - bind .t.f <1> {lappend x .t.f} - event generate .t.f <1> + bind Test <Button-1> {lappend x Test} + bind .t.f <Button-1> {lappend x .t.f} + event generate .t.f <Button-1> return $x } -cleanup { destroy .t.f - bind Test <1> {} + bind Test <Button-1> {} } -result {.t.f Test} test bind-13.41 {Tk_BindEvent procedure: continue in script} -setup { frame .t.f -class Test -width 150 -height 100 @@ -1065,7 +1065,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 @@ -1084,7 +1084,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 @@ -1099,14 +1099,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-1> event generate .t.f <ButtonRelease-1> @@ -1115,7 +1115,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 @@ -1131,14 +1131,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-1> event generate .t.f <Key-a> @@ -1148,14 +1148,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-1> event generate .t.f <Key-Shift_L> @@ -1165,7 +1165,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 @@ -1180,7 +1180,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 @@ -1193,7 +1193,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 @@ -1206,7 +1206,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 @@ -1219,7 +1219,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 { @@ -1238,7 +1238,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 @@ -1252,14 +1252,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1269,14 +1269,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1286,14 +1286,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1303,14 +1303,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1320,14 +1320,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1337,14 +1337,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1354,14 +1354,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1371,14 +1371,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-2> event generate .t.f <ButtonRelease-2> @@ -1388,14 +1388,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-1> -time -100 event generate .t.f <Button-1> -time 200 @@ -1403,14 +1403,14 @@ 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 focus -force .t.f update } -body { - bind .t.f <Double-1> {set x 1} + bind .t.f <Double-Button-1> {set x 1} set x 0 event generate .t.f <Button-1> -time -100 event generate .t.f <Button-1> -time 500 @@ -1418,7 +1418,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 @@ -1485,14 +1485,14 @@ test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup { focus -force .t.f update } -body { - bind .t.f <KeyPress> {set x 0} + bind .t.f <Key> {set x 0} bind .t.f 1 {set x 1} set x none event generate .t.f <Key-1> 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 @@ -1500,14 +1500,14 @@ test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup { focus -force .t.f update } -body { - bind .t.f <KeyPress> {set x 0} + bind .t.f <Key> {set x 0} bind .t.f 1 {set x 1} set x none event generate .t.f <Key-2> 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 @@ -1515,7 +1515,7 @@ test bind-15.29 {MatchPatterns procedure, conflict resolution} -setup { focus -force .t.f update } -body { - bind .t.f <KeyPress> {lappend x 0} + bind .t.f <Key> {lappend x 0} bind .t.f 1 {lappend x 1} bind .t.f 21 {lappend x 2} set x none @@ -1532,15 +1532,15 @@ test bind-15.30 {MatchPatterns procedure, conflict resolution} -setup { focus -force .t.f update } -body { - bind .t.f <ButtonPress> {set x 0} - bind .t.f <1> {set x 1} + bind .t.f <Button> {set x 0} + bind .t.f <Button-1> {set x 1} set x none event generate .t.f <Button-1> event generate .t.f <ButtonRelease-1> 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 @@ -1554,7 +1554,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 @@ -1568,7 +1568,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 @@ -1576,9 +1576,9 @@ test bind-15.33 {MatchPatterns procedure, conflict resolution} -setup { update set x {} } -body { - bind .t.f <1> {lappend x single} - bind Test <1> {lappend x single(Test)} - bind Test <Double-1> {lappend x double(Test)} + bind .t.f <Button-1> {lappend x single} + bind Test <Button-1> {lappend x single(Test)} + bind Test <Double-Button-1> {lappend x double(Test)} event generate .t.f <Button-1> event generate .t.f <Button-1> event generate .t.f <Button-1> @@ -1586,8 +1586,8 @@ test bind-15.33 {MatchPatterns procedure, conflict resolution} -setup { set x } -cleanup { destroy .t.f - bind Test <1> {} - bind Test <Double-1> {} + bind Test <Button-1> {} + bind Test <Double-Button-1> {} } -result {single single(Test) single double(Test) single double(Test)} @@ -1616,7 +1616,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 @@ -1643,7 +1643,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 @@ -1656,7 +1656,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 @@ -1760,7 +1760,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 @@ -1799,7 +1799,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 @@ -1865,7 +1865,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 @@ -1878,7 +1878,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 @@ -1891,7 +1891,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 @@ -1924,14 +1924,14 @@ test bind-16.26 {ExpandPercents procedure} -setup { focus -force .t.f update } -body { - bind .t.f <1> {set x "%s"} + bind .t.f <Button-1> {set x "%s"} set x none event generate .t.f <Button-1> -state 1402 event generate .t.f <ButtonRelease-1> 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 @@ -1944,7 +1944,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 @@ -1997,7 +1997,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 @@ -2076,7 +2076,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 @@ -2089,7 +2089,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 { @@ -2124,7 +2124,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 @@ -2150,7 +2150,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 @@ -2251,7 +2251,7 @@ test bind-17.4 {event command: add 1} -body { event info <<Paste>> } -cleanup { event delete <<Paste>> <Control-v> -} -result {<Control-Key-v>} +} -result <Control-Key-v> test bind-17.5 {event command: add 2} -body { event delete <<Paste>> event add <<Paste>> <Control-v> <Button-2> @@ -2261,13 +2261,13 @@ test bind-17.5 {event command: add 2} -body { } -result {<Button-2> <Control-Key-v>} test bind-17.6 {event command: add with error} -body { - event add <<Paste>> <Control-v> <Button-2> abc <xyz> <1> + event add <<Paste>> <Control-v> <Button-2> abc <xyz> <Button-1> } -cleanup { event delete <<Paste>> } -returnCodes error -result {bad event type or keysym "xyz"} test bind-17.7 {event command: add with error} -body { event delete <<Paste>> - catch {event add <<Paste>> <Control-v> <Button-2> abc <xyz> <1>} + catch {event add <<Paste>> <Control-v> <Button-2> abc <xyz> <Button-1>} lsort [event info <<Paste>>] } -cleanup { event delete <<Paste>> @@ -2278,12 +2278,12 @@ test bind-17.8 {event command: delete} -body { } -returnCodes error -result {wrong # args: should be "event delete virtual ?sequence ...?"} test bind-17.9 {event command: delete many} -body { event delete <<Paste>> - event add <<Paste>> <3> <1> <2> t - event delete <<Paste>> <1> <2> + event add <<Paste>> <Button-3> <Button-1> <Button-2> t + event delete <<Paste>> <Button-1> <Button-2> lsort [event info <<Paste>>] } -cleanup { event delete <<Paste>> - event delete <<Paste>> <3> t + event delete <<Paste>> <Button-3> t } -result {<Button-3> t} test bind-17.10 {event command: delete all} -body { event add <<Paste>> a b @@ -2331,12 +2331,12 @@ test bind-17.16 {event command: generate} -setup { update set x {} } -body { - bind .t.f <1> "lappend x 1" - event generate .t.f <1> + bind .t.f <Button-1> "lappend x 1" + event generate .t.f <Button-1> 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 @@ -2364,7 +2364,7 @@ test bind-18.3 {CreateVirtualEvent procedure: new physical} -body { event info <<xyz>> } -cleanup { event delete <<xyz>> -} -result {<Control-Key-v>} +} -result <Control-Key-v> test bind-18.4 {CreateVirtualEvent procedure: duplicate physical} -body { event delete <<xyz>> event add <<xyz>> <Control-v> @@ -2372,7 +2372,7 @@ test bind-18.4 {CreateVirtualEvent procedure: duplicate physical} -body { event info <<xyz>> } -cleanup { event delete <<xyz>> -} -result {<Control-Key-v>} +} -result <Control-Key-v> test bind-18.5 {CreateVirtualEvent procedure: existing physical} -body { foreach p [event info] {event delete $p} event add <<xyz>> <Control-v> @@ -2421,7 +2421,7 @@ test bind-19.4 {DeleteVirtualEvent procedure: delete 1, not owned} -setup { event add <<xyz>> <Control-v> event delete <<xyz>> <Button-1> event info <<xyz>> -} -result {<Control-Key-v>} +} -result <Control-Key-v> test bind-19.5 {DeleteVirtualEvent procedure: delete 1, badly formed} -body { event add <<xyz>> <Control-v> event delete <<xyz>> <xyz> @@ -2478,7 +2478,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 @@ -2703,7 +2703,7 @@ test bind-20.3 {GetVirtualEvent procedure: owns 1} -setup { event info <<xyz>> } -cleanup { event delete <<xyz>> -} -result {<Control-Key-v>} +} -result <Control-Key-v> test bind-20.4 {GetVirtualEvent procedure: owns many} -setup { event delete <<xyz>> } -body { @@ -2724,7 +2724,7 @@ test bind-21.2 {GetAllVirtualEvents procedure: 1 event} -body { event info } -cleanup { event delete <<xyz>> -} -result {<<xyz>>} +} -result <<xyz>> test bind-21.3 {GetAllVirtualEvents procedure: many events} -body { foreach p [event info] {event delete $p} event add <<xyz>> <Control-v> @@ -2816,7 +2816,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 @@ -2829,7 +2829,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 @@ -2843,7 +2843,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 @@ -2999,7 +2999,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 @@ -3201,7 +3201,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 @@ -3241,7 +3241,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 @@ -3255,7 +3255,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 @@ -3295,7 +3295,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 @@ -3428,7 +3428,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 @@ -3442,7 +3442,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 @@ -3456,7 +3456,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 @@ -3536,7 +3536,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 @@ -3563,7 +3563,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 @@ -3577,7 +3577,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 @@ -3591,7 +3591,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 @@ -3605,7 +3605,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 @@ -3619,7 +3619,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 @@ -3633,7 +3633,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 @@ -3673,7 +3673,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 @@ -3687,7 +3687,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 @@ -3701,7 +3701,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 @@ -3715,7 +3715,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 @@ -3729,7 +3729,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 @@ -3743,7 +3743,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 @@ -3783,7 +3783,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 @@ -3797,7 +3797,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 @@ -3811,7 +3811,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 @@ -3825,7 +3825,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 @@ -3839,7 +3839,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 @@ -3853,7 +3853,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 @@ -3893,7 +3893,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 @@ -3907,7 +3907,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 @@ -3921,7 +3921,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 @@ -3948,7 +3948,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 @@ -3975,7 +3975,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 @@ -3989,7 +3989,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 @@ -4003,7 +4003,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 @@ -4017,7 +4017,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 @@ -4031,7 +4031,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 @@ -4045,7 +4045,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 @@ -4112,7 +4112,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 @@ -4139,7 +4139,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 @@ -4153,7 +4153,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 @@ -4167,7 +4167,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 @@ -4181,7 +4181,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 @@ -4195,7 +4195,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 @@ -4209,7 +4209,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 @@ -4249,7 +4249,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 @@ -4263,7 +4263,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 @@ -4277,7 +4277,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 @@ -4291,7 +4291,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 @@ -4305,7 +4305,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 @@ -4319,7 +4319,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 @@ -4333,7 +4333,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 @@ -4373,7 +4373,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 @@ -4387,7 +4387,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 @@ -4578,7 +4578,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 @@ -4592,7 +4592,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 @@ -4606,7 +4606,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 @@ -4620,7 +4620,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 @@ -4634,7 +4634,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 @@ -4648,7 +4648,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 @@ -4662,7 +4662,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 @@ -4676,7 +4676,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 @@ -4690,7 +4690,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 @@ -4704,7 +4704,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 @@ -4744,7 +4744,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 @@ -4758,7 +4758,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 @@ -4772,7 +4772,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 @@ -4786,7 +4786,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 @@ -4800,7 +4800,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 @@ -4814,7 +4814,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 @@ -4828,7 +4828,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 @@ -4842,7 +4842,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 @@ -4856,7 +4856,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 @@ -4870,7 +4870,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 @@ -4943,10 +4943,10 @@ test bind-24.5 {FindSequence procedure, multiple bindings} -setup { focus -force .t.f update } -body { - bind .t.f <1> {lappend x single} - bind .t.f <Double-1> {lappend x double} - bind .t.f <Triple-1> {lappend x triple} - bind .t.f <Quadruple-1> {lappend x quadruple} + bind .t.f <Button-1> {lappend x single} + bind .t.f <Double-Button-1> {lappend x double} + bind .t.f <Triple-Button-1> {lappend x triple} + bind .t.f <Quadruple-Button-1> {lappend x quadruple} set x press event generate .t.f <Button-1> event generate .t.f <ButtonRelease-1> @@ -5101,7 +5101,7 @@ test bind-25.2 {ParseEventDescription procedure: misinterpreted modifier} -setup button .b } -body { bind .b <Control-M> a - bind .b <M-M> b + bind .b <Meta-M> b lsort [bind .b] } -cleanup { destroy .b @@ -5121,7 +5121,7 @@ test bind-25.4 {ParseEventDescription} -setup { bind .t.f } -cleanup { destroy .t.f -} -result {<<Shift-Paste>>} +} -result <<Shift-Paste>> # Assorted error cases in event sequence parsing test bind-25.5 {ParseEventDescription procedure error cases} -body { @@ -5205,7 +5205,7 @@ test bind-25.21 {modifier names} -setup { test bind-25.22 {modifier names} -setup { frame .t.f -class Test -width 150 -height 100 } -body { - bind .t.f <M-a> foo + bind .t.f <Meta-a> foo bind .t.f } -cleanup { destroy .t.f @@ -5520,9 +5520,9 @@ 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 ButtonPress}" set x xyzzy - event generate .t.f <ButtonPress> + event generate .t.f <Button> list $x [bind .t.f] } -cleanup { destroy .t.f @@ -5618,9 +5618,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 @@ -5939,28 +5939,28 @@ test bind-28.9 {keysym names, Eth -> ETH} -body { bind .t.f } -cleanup { destroy .t.f -} -result {<Key-ETH>} +} -result <Key-ETH> test bind-28.10 {keysym names, Ooblique -> Oslash} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <Ooblique> foo bind .t.f } -cleanup { destroy .t.f -} -result {<Key-Oslash>} +} -result <Key-Oslash> test bind-28.11 {keysym names, gcedilla} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <gcedilla> foo bind .t.f } -cleanup { destroy .t.f -} -result {<Key-gcedilla>} +} -result <Key-gcedilla> test bind-28.12 {keysym names, Greek_IOTAdiaeresis -> Greek_IOTAdieresis} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <Greek_IOTAdiaeresis> foo bind .t.f } -cleanup { destroy .t.f -} -result {<Key-Greek_IOTAdieresis>} +} -result <Key-Greek_IOTAdieresis> test bind-29.1 {Tcl_BackgroundError procedure} -setup { @@ -6041,7 +6041,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 @@ -6171,7 +6171,7 @@ test bind-32.2 {detection of double click should not fail} -setup { update set x {} } -body { - event generate .t.f <ButtonPress-1> + event generate .t.f <Button-1> event generate .t.f <ButtonRelease-1> # Simulate a lot of intervening exposure events. The old implementation # that used an event ring overflowed, and the double click was not detected. @@ -6179,7 +6179,7 @@ test bind-32.2 {detection of double click should not fail} -setup { for {set i 0} {$i < 1000} {incr i} { event generate .t.f <Expose> } - event generate .t.f <ButtonPress-1> + event generate .t.f <Button-1> event generate .t.f <ButtonRelease-1> set x } -cleanup { @@ -6205,10 +6205,10 @@ test bind-32.4 {should not trigger Double-1} -setup { update set x {} } -body { - bind .t.f <Double-1> { set x "Double" } - event generate .t.f <1> -time current + bind .t.f <Double-Button-1> { set x "Double" } + event generate .t.f <Button-1> -time current after 1000 - event generate .t.f <1> -time current + event generate .t.f <Button-1> -time current set x } -cleanup { destroy .t.f @@ -6219,10 +6219,10 @@ test bind-32.5 {should trigger Quadruple-1} -setup { update set x {} } -body { - bind .t.f <Quadruple-1> { set x "Quadruple" } - bind .t.f <Triple-1> { set x "Triple" } - bind .t.f <Double-1> { set x "Double" } - bind .t.f <1> { set x "Single" } + bind .t.f <Quadruple-Button-1> { set x "Quadruple" } + bind .t.f <Triple-Button-1> { set x "Triple" } + bind .t.f <Double-Button-1> { set x "Double" } + bind .t.f <Button-1> { set x "Single" } # Old implementation triggered "Double", but new implementation # triggers "Quadruple", the latter behavior conforms to other toolkits. event generate .t.f <Button-1> -time 0 @@ -6252,10 +6252,10 @@ test bind-32.7 {test sequences} -setup { update set x {} } -body { - bind .t.f <Double-1> { lappend x "Double" } - bind .t.f <1><1><a> { lappend x "11" } - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Double-Button-1> { lappend x "Double" } + bind .t.f <Button-1><Button-1><a> { lappend x "11" } + event generate .t.f <Button-1> + event generate .t.f <Button-1> event generate .t.f <a> set x } -cleanup { @@ -6267,12 +6267,12 @@ test bind-32.8 {test sequences} -setup { update set x {} } -body { - bind .t.f <a><1><Double-1><1><a> { lappend x "Double" } + bind .t.f <a><Button-1><Double-Button-1><Button-1><a> { lappend x "Double" } event generate .t.f <a> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> event generate .t.f <a> set x } -cleanup { @@ -6285,7 +6285,7 @@ test bind-32.9 {trigger events for modifier keys} -setup { set x {} } -body { bind .t.f <Any-Key> { set x "Key" } - event generate .t.f <KeyPress> -keysym Caps_Lock + event generate .t.f <Key> -keysym Caps_Lock set x } -cleanup { destroy .t.f @@ -6295,13 +6295,13 @@ test bind-32.10 {reset key state when destroying window} -setup { } -body { pack [frame .t.f]; update; focus -force .t.f bind .t.f <Key-A> { set x "A" } - event generate .t.f <KeyPress-A> - event generate .t.f <KeyPress-A> + event generate .t.f <Key-A> + event generate .t.f <Key-A> destroy .t.f; update pack [frame .t.f]; update; focus -force .t.f bind .t.f <Key-A> { set x "A" } bind .t.f <Double-Key-A> { set x "AA" } - event generate .t.f <KeyPress-A> + event generate .t.f <Key-A> destroy .t.f set x } -result {A} @@ -6315,7 +6315,7 @@ test bind-32.11 {match detailed virtual} -setup { bind Test <<TestControlButton1>> { set x "Control-Button-1" } bind Test <Button-1> { set x "Button-1" } bind .t.f <Button-1> { set x "Button-1" } - event generate .t.f <Control-ButtonPress-1> + event generate .t.f <Control-Button-1> set x } -cleanup { destroy .t.f @@ -6331,14 +6331,14 @@ test bind-32.12 {don't detect repetition when window has changed} -setup { } -body { bind .t.f <Button-1> { set x "1" } bind .t.f <Double-Button-1> { set x "11" } - event generate .t.f <ButtonPress-1> - event generate .t.g <ButtonPress-1> - event generate .t.f <ButtonPress-1> + event generate .t.f <Button-1> + event generate .t.g <Button-1> + event generate .t.f <Button-1> set x } -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] @@ -6347,9 +6347,9 @@ test bind-32.13 {don't detect repetition when window has changed} -setup { } -body { bind .t.f <Key-A> { set x "A" } bind .t.f <Double-Key-A> { set x "AA" } - focus -force .t.f; event generate .t.f <KeyPress-A> - focus -force .t.g; event generate .t.g <KeyPress-A> - focus -force .t.f; event generate .t.f <KeyPress-A> + focus -force .t.f; event generate .t.f <Key-A> + focus -force .t.g; event generate .t.g <Key-A> + focus -force .t.f; event generate .t.f <Key-A> set x } -cleanup { destroy .t.f @@ -6361,31 +6361,31 @@ test bind-32.14 {don't detect repetition when window has changed} -setup { update set x {} } -body { - bind .t.f <ButtonPress-1> { set x "1" } - bind .t.f <Double-ButtonPress-1> { set x "11" } - focus -force .t.f; event generate .t.f <ButtonPress-1> - focus -force .t.g; event generate .t.g <ButtonPress-1> - focus -force .t.f; event generate .t.f <ButtonPress-1> + bind .t.f <Button-1> { set x "1" } + bind .t.f <Double-Button-1> { set x "11" } + focus -force .t.f; event generate .t.f <Button-1> + focus -force .t.g; event generate .t.g <Button-1> + focus -force .t.f; event generate .t.f <Button-1> set x } -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 { pack [frame .t.f]; update; focus -force .t.f - bind .t.f <ButtonPress-1> { set x "1" } - event generate .t.f <ButtonPress-1> - event generate .t.f <ButtonPress-1> + bind .t.f <Button-1> { set x "1" } + event generate .t.f <Button-1> + event generate .t.f <Button-1> destroy .t.f; update pack [frame .t.f]; update; focus -force .t.f - bind .t.f <ButtonPress-1> { set x "1" } - bind .t.f <Double-ButtonPress-1> { set x "11" } - event generate .t.f <ButtonPress-1> + bind .t.f <Button-1> { set x "1" } + bind .t.f <Double-Button-1> { set x "11" } + 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] @@ -6393,179 +6393,179 @@ test bind-33.1 {prefer longest match} -setup { update set x {} } -body { - bind .t.f <a><1><1> { lappend x "a11" } - bind .t.f <Double-1> { lappend x "Double" } + bind .t.f <a><Button-1><Button-1> { lappend x "a11" } + bind .t.f <Double-Button-1> { lappend x "Double" } event generate .t.f <a> - event generate .t.f <1> - event generate .t.f <1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> set x } -cleanup { destroy .t.f } -result {a11} -test bind-33.2 {should prefer most specific event} -setup { +test bind-33.2 {prefer most specific event} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <Double-1> { lappend x "Double" } - bind .t.f <1><1> { lappend x "11" } - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Double-Button-1> { lappend x "Double" } + bind .t.f <Button-1><Button-1> { lappend x "11" } + event generate .t.f <Button-1> + event generate .t.f <Button-1> set x } -cleanup { destroy .t.f # This test case shows that old implementation has an issue, because - # it is expected that <Double-1> is matching, this binding + # it is expected that <Double-Button-1> is matching, this binding # is more specific. But new implementation will be conform to old, # and so "11" is the expected result. -} -result {11} +} -result 11 test bind-33.3 {should prefer most specific event} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <a><Double-1><a> { lappend x "Double" } - bind .t.f <a><1><1><a> { lappend x "11" } + bind .t.f <a><Double-Button-1><a> { lappend x "Double" } + bind .t.f <a><Button-1><Button-1><a> { lappend x "11" } event generate .t.f <a> - event generate .t.f <1> - event generate .t.f <1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> event generate .t.f <a> set x } -cleanup { destroy .t.f # Also this test case shows that old implementation has an issue, it is - # expected that <a><Double-1><a> is matching, because <Double-1> is more - # specific than <1><1>. But new implementation will be conform to old, + # expected that <a><Double-Button-1><a> is matching, because <Double-Button-1> is more + # specific than <Button-1><Button-1>. But new implementation will be conform to old, # and so "11" is the expected result. -} -result {11} +} -result 11 test bind-33.4 {prefer most specific event} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <1><1> { lappend x "11" } - bind .t.f <Double-1> { lappend x "Double" } - event generate .t.f <1> -time 0 - event generate .t.f <1> -time 1000 + bind .t.f <Button-1><Button-1> { lappend x "11" } + bind .t.f <Double-Button-1> { lappend x "Double" } + event generate .t.f <Button-1> -time 0 + event generate .t.f <Button-1> -time 1000 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 update set x {} } -body { - bind .t.f <1><1> { lappend x "11" } - bind .t.f <Double-ButtonPress> { lappend x "Double" } - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Button-1><Button-1> { lappend x "11" } + bind .t.f <Double-Button> { lappend x "Double" } + event generate .t.f <Button-1> + event generate .t.f <Button-1> 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 update set x {} } -body { - bind .t.f <a><1><1><1><1><a> { lappend x "1111" } - bind .t.f <a><ButtonPress><Double-ButtonPress><ButtonPress><a> { lappend x "Any-Double-Any" } + bind .t.f <a><Button-1><Button-1><Button-1><Button-1><a> { lappend x "1111" } + bind .t.f <a><Button><Double-Button><Button><a> { lappend x "Any-Double-Any" } event generate .t.f <a> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> event generate .t.f <a> 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 update set x {} } -body { - bind .t.f <ButtonPress-1><a> { lappend x "1" } - bind .t.f <ButtonPress><a> { lappend x "Any" } - event generate .t.f <1> + bind .t.f <Button-1><a> { lappend x "1" } + bind .t.f <Button><a> { lappend x "Any" } + event generate .t.f <Button-1> event generate .t.f <a> 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 update set x {} } -body { - bind .t.f <Double-ButtonPress-1><a> { lappend x "1" } - bind .t.f <ButtonPress><ButtonPress><a> { lappend x "Any" } - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Double-Button-1><a> { lappend x "1" } + bind .t.f <Button><Button><a> { lappend x "Any" } + event generate .t.f <Button-1> + event generate .t.f <Button-1> event generate .t.f <a> 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 update set x {} } -body { - bind .t.f <1><2><2><Double-1> { lappend x "first" } - bind .t.f <1><Double-2><1><1> { lappend x "last" } - event generate .t.f <1> - event generate .t.f <2> - event generate .t.f <2> - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Button-1><Button-2><Button-2><Double-Button-1> { lappend x "first" } + bind .t.f <Button-1><Double-Button-2><Button-1><Button-1> { lappend x "last" } + event generate .t.f <Button-1> + event generate .t.f <Button-2> + event generate .t.f <Button-2> + event generate .t.f <Button-1> + event generate .t.f <Button-1> set x } -cleanup { destroy .t.f -} -result {last} +} -result last test bind-33.10 {prefer last in case of homogeneous equal patterns} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <1><Double-2><1><1> { lappend x "first" } - bind .t.f <1><2><2><Double-1> { lappend x "last" } - event generate .t.f <1> - event generate .t.f <2> - event generate .t.f <2> - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Button-1><Double-Button-2><Button-1><Button-1> { lappend x "first" } + bind .t.f <Button-1><Button-2><Button-2><Double-Button-1> { lappend x "last" } + event generate .t.f <Button-1> + event generate .t.f <Button-2> + event generate .t.f <Button-2> + event generate .t.f <Button-1> + event generate .t.f <Button-1> set x } -cleanup { destroy .t.f -} -result {last} +} -result last test bind-33.11 {should prefer most specific} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <2><Double-1><Double-2><Double-1><2><2> { lappend x "first" } - bind .t.f <2><1><1><2><2><Double-1><Double-2> { lappend x "last" } - event generate .t.f <2> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <2> - event generate .t.f <2> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <2> - event generate .t.f <2> + bind .t.f <Button-2><Double-Button-1><Double-Button-2><Double-Button-1><Button-2><Button-2> { lappend x "first" } + bind .t.f <Button-2><Button-1><Button-1><Button-2><Button-2><Double-Button-1><Double-Button-2> { lappend x "last" } + event generate .t.f <Button-2> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-2> + event generate .t.f <Button-2> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-2> + event generate .t.f <Button-2> set x } -cleanup { destroy .t.f @@ -6573,73 +6573,73 @@ test bind-33.11 {should prefer most specific} -setup { # it is expected that first one is matching, this binding # is more specific. But new implementation will be conform to old, # and so "last" is the expected result. -} -result {last} +} -result last test bind-33.12 {prefer last in case of homogeneous equal patterns} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <Control-1><1> { lappend x "first" } - bind .t.f <1><Control-1> { lappend x "last" } - event generate .t.f <Control-1> - event generate .t.f <Control-1> + bind .t.f <Control-Button-1><Button-1> { lappend x "first" } + bind .t.f <Button-1><Control-Button-1> { lappend x "last" } + event generate .t.f <Control-Button-1> + event generate .t.f <Control-Button-1> set x } -cleanup { destroy .t.f -} -result {last} +} -result last test bind-33.13 {prefer last in case of homogeneous equal patterns} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <1><Control-1> { lappend x "first" } - bind .t.f <Control-1><1> { lappend x "last" } - event generate .t.f <Control-1> - event generate .t.f <Control-1> + bind .t.f <Button-1><Control-Button-1> { lappend x "first" } + bind .t.f <Control-Button-1><Button-1> { lappend x "last" } + event generate .t.f <Control-Button-1> + event generate .t.f <Control-Button-1> set x } -cleanup { destroy .t.f # Old implementation failed, and returned "first", but this was wrong, # because both bindings are homogeneous equal, so the most recently defined # must be preferred. -} -result {last} +} -result last test bind-33.14 {prefer last in case of homogeneous equal patterns} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <1><ButtonPress><1><ButtonPress> { lappend x "first" } - bind .t.f <ButtonPress><1><ButtonPress><1> { lappend x "last" } - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Button-1><Button><Button-1><Button> { lappend x "first" } + bind .t.f <Button><Button-1><Button><Button-1> { lappend x "last" } + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> set x } -cleanup { destroy .t.f -} -result {last} +} -result last test bind-33.15 {prefer last in case of homogeneous equal patterns} -setup { pack [frame .t.f] focus -force .t.f update set x {} } -body { - bind .t.f <ButtonPress><1><ButtonPress><1> { lappend x "first" } - bind .t.f <1><ButtonPress><1><ButtonPress> { lappend x "last" } - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> - event generate .t.f <1> + bind .t.f <Button><Button-1><Button><Button-1> { lappend x "first" } + bind .t.f <Button-1><Button><Button-1><Button> { lappend x "last" } + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> + event generate .t.f <Button-1> set x } -cleanup { destroy .t.f # Old implementation failed, and returned "first", but this was wrong, # because both bindings are homogeneous equal, so the most recently defined # must be preferred. -} -result {last} +} -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 @@ -6698,7 +6698,7 @@ test bind-33.19 {simulate use of the keyboard to trigger a pattern sequence with set x {} } -body { bind .t.f <Escape><Control-c> { lappend x "Esc_Control-c" } - bind .t.f <Escape><KeyPress><KeyPress><Control-c> { lappend x "Esc_Key(2)_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> @@ -6769,7 +6769,7 @@ 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 @@ -6824,7 +6824,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 } @@ -6898,8 +6898,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 } @@ -6917,7 +6917,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] } @@ -6985,7 +6985,7 @@ test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup { } -cleanup { destroy .top unset x1 y1 x2 y2 -} -result {1} +} -result 1 # cleanup cleanupTests |