summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/arc.tcl10
-rw-r--r--tests/bind.test526
-rw-r--r--tests/canvas.test2
-rw-r--r--tests/choosedir.test4
-rw-r--r--tests/clrpick.test4
-rw-r--r--tests/dialog.test4
-rw-r--r--tests/event.test58
-rw-r--r--tests/filebox.test4
-rw-r--r--tests/focus.test6
-rw-r--r--tests/listbox.test4
-rw-r--r--tests/menu.test4
-rw-r--r--tests/msgbox.test4
-rw-r--r--tests/scale.test12
-rw-r--r--tests/scrollbar.test12
-rw-r--r--tests/text.test18
-rw-r--r--tests/textTag.test12
-rw-r--r--tests/ttk/checkbutton.test2
-rw-r--r--tests/ttk/treetags.test14
-rw-r--r--tests/ttk/treeview.test6
-rw-r--r--tests/ttk/ttk.test4
-rw-r--r--tests/unixEmbed.test32
-rw-r--r--tests/visual_bb.test4
-rw-r--r--tests/winWm.test4
23 files changed, 375 insertions, 375 deletions
diff --git a/tests/arc.tcl b/tests/arc.tcl
index 0126c7d..2887047 100644
--- a/tests/arc.tcl
+++ b/tests/arc.tcl
@@ -52,7 +52,7 @@ set outline black
.t.c addtag arc withtag all
.t.c addtag circle withtag [.t.c create oval 320 200 340 220 -fill MistyRose3]
-.t.c bind arc <Any-Enter> {
+.t.c bind arc <Enter> {
set prevFill [lindex [.t.c itemconf current -fill] 4]
set prevOutline [lindex [.t.c itemconf current -outline] 4]
if {($prevFill != "") || ($prevOutline == "")} {
@@ -62,9 +62,9 @@ set outline black
.t.c itemconf current -outline $outline2
}
}
-.t.c bind arc <Any-Leave> {.t.c itemconf current -fill $prevFill -outline $prevOutline}
+.t.c bind arc <Leave> {.t.c itemconf current -fill $prevFill -outline $prevOutline}
-bind .t.c <1> {markarea %x %y}
+bind .t.c <Button-1> {markarea %x %y}
bind .t.c <B1-Motion> {strokearea %x %y}
proc markarea {x y} {
@@ -89,11 +89,11 @@ bind .t.c <Control-f> {
puts stdout "Overlapping: [.t.c find overl $areaX1 $areaY1 $areaX2 $areaY2]"
}
-bind .t.c <3> {puts stdout "%x %y"}
+bind .t.c <Button-3> {puts stdout "%x %y"}
# The code below allows the circle to be move by shift-dragging.
-bind .t.c <Shift-1> {
+bind .t.c <Shift-Button-1> {
set curx %x
set cury %y
}
diff --git a/tests/bind.test b/tests/bind.test
index acae894..4b4e5fc 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -297,9 +297,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
@@ -312,17 +312,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}
@@ -356,10 +356,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]]
}
@@ -393,7 +393,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]
@@ -402,7 +402,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]
@@ -417,7 +417,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
@@ -430,23 +430,23 @@ 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 Key"}
+ bind all <Key> {lappend x "%W %K all Key"}
bind Test : {lappend x "%W %K Test :"}
bind all _ {lappend x "%W %K all _"}
bind .t.f : {lappend x "%W %K .t.f :"}
- event generate .t.f <Key-colon>
- event generate .t.f <Key-plus>
- event generate .t.f <Key-underscore>
+ event generate .t.f <colon>
+ event generate .t.f <plus>
+ event generate .t.f <underscore>
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 _}}
+} -result {{.t.f colon .t.f :} {.t.f colon Test :} {.t.f colon all Key} {.t.f plus Test Key} {.t.f plus all Key} {.t.f underscore Test Key} {.t.f underscore all _}}
test bind-13.2 {Tk_BindEvent procedure} -setup {
frame .t.f -class Test -width 150 -height 100
@@ -455,16 +455,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>
+ event generate .t.f <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 {
@@ -475,14 +475,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>
+ event generate .t.f <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
@@ -491,7 +491,7 @@ test bind-13.3 {Tk_BindEvent procedure} -setup {
test bind-13.4 {Tk_BindEvent procedure} -setup {
proc foo {} {
set x 44
- event generate .t.f <Key-colon>
+ event generate .t.f <colon>
}
frame .t.f -class Test -width 150 -height 100
pack .t.f
@@ -534,7 +534,7 @@ test bind-13.7 {Tk_BindEvent procedure} -setup {
bind .t.f : {lappend x "%W (.t.f binding)"}
bind Test : {lappend x "%W (Test binding)"}
bind all : {bind .t.f : {}; lappend x "%W (all binding)"}
- event generate .t.f <Key-colon>
+ event generate .t.f <colon>
return $x
} -cleanup {
bind Test : {}
@@ -551,7 +551,7 @@ test bind-13.8 {Tk_BindEvent procedure} -setup {
bind .t.f : {lappend x "%W (.t.f binding)"}
bind Test : {lappend x "%W (Test binding)"}
bind all : {destroy .t.f; lappend x "%W (all binding)"}
- event generate .t.f <Key-colon>
+ event generate .t.f <colon>
return $x
} -cleanup {
bind Test : {}
@@ -566,14 +566,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
@@ -616,9 +616,9 @@ test bind-13.12 {Tk_BindEvent procedure: collapse repeating modifiers} -setup {
} -body {
bind .t.f <Key> "lappend x %K%#"
bind .t.f <KeyRelease> "lappend x %K%#"
- event generate .t.f <Key-Shift_L> -serial 100 -when tail
+ event generate .t.f <Shift_L> -serial 100 -when tail
event generate .t.f <KeyRelease-Shift_L> -serial 101 -when tail
- event generate .t.f <Key-Shift_L> -serial 102 -when tail
+ event generate .t.f <Shift_L> -serial 102 -when tail
event generate .t.f <KeyRelease-Shift_L> -serial 103 -when tail
update
} -cleanup {
@@ -936,12 +936,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 {
@@ -966,8 +966,8 @@ 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
@@ -979,13 +979,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
@@ -1094,7 +1094,7 @@ test bind-15.4 {MatchPatterns procedure, ignoring type mismatches} -setup {
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>
@@ -1126,10 +1126,10 @@ test bind-15.6 {MatchPatterns procedure, ignoring type mismatches} -setup {
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>
+ event generate .t.f <a>
event generate .t.f <ButtonRelease-1>
event generate .t.f <Button-1>
event generate .t.f <ButtonRelease-1>
@@ -1143,10 +1143,10 @@ test bind-15.7 {MatchPatterns procedure, ignoring type mismatches} -setup {
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>
+ event generate .t.f <Shift_L>
event generate .t.f <ButtonRelease-1>
event generate .t.f <Button-1>
event generate .t.f <ButtonRelease-1>
@@ -1162,9 +1162,9 @@ test bind-15.8 {MatchPatterns procedure, ignoring type mismatches} -setup {
} -body {
bind .t.f ab {set x 1}
set x 0
- event generate .t.f <Key-a>
- event generate .t.f <Key-c>
- event generate .t.f <Key-b>
+ event generate .t.f <a>
+ event generate .t.f <c>
+ event generate .t.f <b>
return $x
} -cleanup {
destroy .t.f
@@ -1177,7 +1177,7 @@ test bind-15.9 {MatchPatterns procedure, modifier checks} -setup {
} -body {
bind .t.f <M1-M2-Key> {set x 1}
set x 0
- event generate .t.f <Key-a> -state 0x18
+ event generate .t.f <a> -state 0x18
return $x
} -cleanup {
destroy .t.f
@@ -1190,7 +1190,7 @@ test bind-15.10 {MatchPatterns procedure, modifier checks} -setup {
} -body {
bind .t.f <M1-M2-Key> {set x 1}
set x 0
- event generate .t.f <Key-a> -state 0xfc
+ event generate .t.f <a> -state 0xfc
return $x
} -cleanup {
destroy .t.f
@@ -1203,7 +1203,7 @@ test bind-15.11 {MatchPatterns procedure, modifier checks} -setup {
} -body {
bind .t.f <M1-M2-Key> {set x 1}
set x 0
- event generate .t.f <Key-a> -state 0x8
+ event generate .t.f <a> -state 0x8
return $x
} -cleanup {
destroy .t.f
@@ -1220,9 +1220,9 @@ test bind-15.12 {MatchPatterns procedure, ignore modifier presses and releases}
# differently on some platforms.
bind .t.f aB {set x 1}
set x 0
- event generate .t.f <Key-a>
- event generate .t.f <Key-Shift_L>
- event generate .t.f <Key-b> -state 1
+ event generate .t.f <a>
+ event generate .t.f <Shift_L>
+ event generate .t.f <b> -state 1
return $x
} -cleanup {
destroy .t.f
@@ -1235,8 +1235,8 @@ test bind-15.13 {MatchPatterns procedure, checking detail} -setup {
} -body {
bind .t.f ab {set x 1}
set x 0
- event generate .t.f <Key-a>
- event generate .t.f <Key-c>
+ event generate .t.f <a>
+ event generate .t.f <c>
return $x
} -cleanup {
destroy .t.f
@@ -1247,7 +1247,7 @@ test bind-15.14 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1264,7 +1264,7 @@ test bind-15.15 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1281,7 +1281,7 @@ test bind-15.16 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1298,7 +1298,7 @@ test bind-15.17 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1315,7 +1315,7 @@ test bind-15.18 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1332,7 +1332,7 @@ test bind-15.19 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1349,7 +1349,7 @@ test bind-15.20 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1366,7 +1366,7 @@ test bind-15.21 {MatchPatterns procedure, checking "nearby"} -setup {
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>
@@ -1383,7 +1383,7 @@ test bind-15.22 {MatchPatterns procedure, time wrap-around} -setup {
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
@@ -1398,7 +1398,7 @@ test bind-15.23 {MatchPatterns procedure, time wrap-around} -setup {
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
@@ -1472,7 +1472,7 @@ 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>
@@ -1486,7 +1486,7 @@ 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>
@@ -1500,7 +1500,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
@@ -1517,8 +1517,8 @@ 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>
@@ -1535,7 +1535,7 @@ test bind-15.31 {MatchPatterns procedure, conflict resolution} -setup {
} -body {
bind .t.f <M1-Key> {set x 0}
bind .t.f <M2-Key> {set x 1}
- event generate .t.f <Key-a> -state 0x18
+ event generate .t.f <a> -state 0x18
return $x
} -cleanup {
destroy .t.f
@@ -1549,7 +1549,7 @@ test bind-15.32 {MatchPatterns procedure, conflict resolution} -setup {
bind .t.f <M2-Key> {set x 0}
bind .t.f <M1-Key> {set x 1}
set x none
- event generate .t.f <Key-a> -state 0x18
+ event generate .t.f <a> -state 0x18
return $x
} -cleanup {
destroy .t.f
@@ -1561,9 +1561,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>
@@ -1571,8 +1571,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)}
@@ -1909,7 +1909,7 @@ 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>
@@ -2033,18 +2033,18 @@ test bind-16.35 {ExpandPercents procedure} -constraints {
set x {}
} -body {
bind .t.f <Key> {lappend x "%A"}
- event generate .t.f <Key-a>
- event generate .t.f <Key-A> -state 1
- event generate .t.f <Key-Tab>
- event generate .t.f <Key-Return>
- event generate .t.f <Key-F1>
- event generate .t.f <Key-Shift_L>
- event generate .t.f <Key-space>
- event generate .t.f <Key-dollar> -state 1
- event generate .t.f <Key-braceleft> -state 1
- event generate .t.f <Key-Multi_key>
- event generate .t.f <Key-e>
- event generate .t.f <Key-apostrophe>
+ event generate .t.f <a>
+ event generate .t.f <A> -state 1
+ event generate .t.f <Tab>
+ event generate .t.f <Return>
+ event generate .t.f <F1>
+ event generate .t.f <Shift_L>
+ event generate .t.f <space>
+ event generate .t.f <dollar> -state 1
+ event generate .t.f <braceleft> -state 1
+ event generate .t.f <Multi_key>
+ event generate .t.f <e>
+ event generate .t.f <apostrophe>
set x
} -cleanup {
destroy .t.f
@@ -2085,14 +2085,14 @@ test bind-16.38 {ExpandPercents procedure} -constraints {
set x {}
} -body {
bind .t.f <Key> {lappend x %K}
- event generate .t.f <Key-a>
- event generate .t.f <Key-A> -state 1
- event generate .t.f <Key-Tab>
- event generate .t.f <Key-F1>
- event generate .t.f <Key-Shift_L>
- event generate .t.f <Key-space>
- event generate .t.f <Key-dollar> -state 1
- event generate .t.f <Key-braceleft> -state 1
+ event generate .t.f <a>
+ event generate .t.f <A> -state 1
+ event generate .t.f <Tab>
+ event generate .t.f <F1>
+ event generate .t.f <Shift_L>
+ event generate .t.f <space>
+ event generate .t.f <dollar> -state 1
+ event generate .t.f <braceleft> -state 1
set x
} -cleanup {
destroy .t.f
@@ -2105,7 +2105,7 @@ test bind-16.39 {ExpandPercents procedure} -setup {
} -body {
bind .t.f <Key> {set x "%N"}
set x none
- event generate .t.f <Key-space>
+ event generate .t.f <space>
set x
} -cleanup {
destroy .t.f
@@ -2118,7 +2118,7 @@ test bind-16.40 {ExpandPercents procedure} -setup {
} -body {
bind .t.f <Key> {set x "%S"}
set x none
- event generate .t.f <Key-space> -subwindow .t
+ event generate .t.f <space> -subwindow .t
set x
} -cleanup {
destroy .t.f
@@ -2191,7 +2191,7 @@ test bind-16.45 {ExpandPercents procedure} -setup {
bind Entry <Key> {set y "%M"}
bind all <Key> {set z "%M"}
set x none; set y none; set z none
- event gen .t.e <Key-a>
+ event gen .t.e <a>
list $x $y $z
} -cleanup {
destroy .t.e
@@ -2212,7 +2212,7 @@ test bind-16.46 {ExpandPercents procedure} -setup {
bind Entry <Key> {set y "%M"}
bind .t.e <Key> {set x "%M"}
set x none; set y none; set z none
- event gen .t.e <Key-a>
+ event gen .t.e <a>
list $x $y $z
} -cleanup {
destroy .t.e
@@ -2246,13 +2246,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>>
@@ -2263,12 +2263,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
@@ -2316,8 +2316,8 @@ 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
@@ -2684,7 +2684,7 @@ test bind-20.2 {GetVirtualEvent procedure: non-existent event} -body {
test bind-20.3 {GetVirtualEvent procedure: owns 1} -setup {
event delete <<xyz>>
} -body {
- event add <<xyz>> <Control-Key-v>
+ event add <<xyz>> <Control-v>
event info <<xyz>>
} -cleanup {
event delete <<xyz>>
@@ -2715,7 +2715,7 @@ test bind-21.3 {GetAllVirtualEvents procedure: many events} -body {
event add <<xyz>> <Control-v>
event add <<xyz>> <Button-2>
event add <<abc>> <Control-v>
- event add <<def>> <Key-F6>
+ event add <<def>> <F6>
lsort [event info]
} -cleanup {
event delete <<xyz>>
@@ -2784,7 +2784,7 @@ test bind-22.10 {HandleEventGenerate} -setup {
set x {}
} -body {
bind .t.f <Key> {set x "%s %K"}
- event generate .t.f <Control-Key-space>
+ event generate .t.f <Control-space>
set x
} -cleanup {
destroy .t.f
@@ -4928,10 +4928,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>
@@ -5944,7 +5944,7 @@ test bind-28.2 {keysym names} -body {
bind .t <Gorp> foo
} -returnCodes error -result {bad event type or keysym "Gorp"}
test bind-28.3 {keysym names} -body {
- bind .t <Key-Stupid> foo
+ bind .t <Stupid> foo
} -returnCodes error -result {bad event type or keysym "Stupid"}
test bind-28.4 {keysym names} -body {
frame .t.f -class Test -width 150 -height 100
@@ -5960,10 +5960,10 @@ test bind-28.5 {keysym names} -setup {
focus -force .t.f
update
} -body {
- bind .t.f <Key-colon> "lappend x \"keysym received\""
- bind .t.f <Key-underscore> "lappend x {bad binding match}"
+ bind .t.f <colon> "lappend x \"keysym received\""
+ bind .t.f <underscore> "lappend x {bad binding match}"
set x [lsort [bind .t.f]]
- event generate .t.f <Key-colon> ;# -state 0
+ event generate .t.f <colon> ;# -state 0
set x
} -cleanup {
destroy .t.f
@@ -5974,10 +5974,10 @@ test bind-28.6 {keysym names} -setup {
focus -force .t.f
update
} -body {
- bind .t.f <Key-Return> "lappend x \"keysym Return\""
- bind .t.f <Key-x> "lappend x {bad binding match}"
+ bind .t.f <Return> "lappend x \"keysym Return\""
+ bind .t.f <x> "lappend x {bad binding match}"
set x [lsort [bind .t.f]]
- event generate .t.f <Key-Return> -state 0
+ event generate .t.f <Return> -state 0
set x
} -cleanup {
destroy .t.f
@@ -5988,10 +5988,10 @@ test bind-28.7 {keysym names} -setup {
focus -force .t.f
update
} -body {
- bind .t.f <Key-X> "lappend x \"keysym X\""
- bind .t.f <Key-x> "lappend x {bad binding match}"
+ bind .t.f <X> "lappend x \"keysym X\""
+ bind .t.f <x> "lappend x {bad binding match}"
set x [lsort [bind .t.f]]
- event generate .t.f <Key-X> -state 1
+ event generate .t.f <X> -state 1
set x
} -cleanup {
destroy .t.f
@@ -6002,10 +6002,10 @@ test bind-28.8 {keysym names} -setup {
focus -force .t.f
update
} -body {
- bind .t.f <Key-X> "lappend x \"keysym X\""
- bind .t.f <Key-x> "lappend x {bad binding match}"
+ bind .t.f <X> "lappend x \"keysym X\""
+ bind .t.f <x> "lappend x {bad binding match}"
set x [lsort [bind .t.f]]
- event generate .t.f <Key-X> -state 1
+ event generate .t.f <X> -state 1
set x
} -cleanup {
destroy .t.f
@@ -6247,7 +6247,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.
@@ -6255,7 +6255,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 {
@@ -6267,10 +6267,10 @@ test bind-32.3 {should trigger best match of modifier states} -setup {
update
set x {}
} -body {
- bind .t.f <Alt-Control-Key-A> { lappend x "Alt-Control" }
- bind .t.f <Shift-Control-Key-A> { lappend x "Shift-Control" }
- bind .t.f <Shift-Key-A> { lappend x "Shift" }
- event generate .t.f <Alt-Control-Key-A>
+ bind .t.f <Alt-Control-A> { lappend x "Alt-Control" }
+ bind .t.f <Shift-Control-A> { lappend x "Shift-Control" }
+ bind .t.f <Shift-A> { lappend x "Shift" }
+ event generate .t.f <Alt-Control-A>
set x
} -cleanup {
destroy .t.f
@@ -6281,10 +6281,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
@@ -6295,10 +6295,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
@@ -6328,10 +6328,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 {
@@ -6343,12 +6343,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 {
@@ -6360,8 +6360,8 @@ test bind-32.9 {trigger events for modifier keys} -setup {
update
set x {}
} -body {
- bind .t.f <Any-Key> { set x "Key" }
- event generate .t.f <KeyPress> -keysym Caps_Lock
+ bind .t.f <Key> { set x "Key" }
+ event generate .t.f <Key> -keysym Caps_Lock
set x
} -cleanup {
destroy .t.f
@@ -6370,14 +6370,14 @@ test bind-32.10 {reset key state when destroying window} -setup {
set x {}
} -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>
+ bind .t.f <A> { set x "A" }
+ event generate .t.f <A>
+ event generate .t.f <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>
+ bind .t.f <A> { set x "A" }
+ bind .t.f <Double-A> { set x "AA" }
+ event generate .t.f <A>
destroy .t.f
set x
} -result {A}
@@ -6391,7 +6391,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
@@ -6407,9 +6407,9 @@ 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
@@ -6421,11 +6421,11 @@ test bind-32.13 {don't detect repetition when window has changed} -setup {
update
set x {}
} -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>
+ bind .t.f <A> { set x "A" }
+ bind .t.f <Double-A> { set x "AA" }
+ focus -force .t.f; event generate .t.f <A>
+ focus -force .t.g; event generate .t.g <A>
+ focus -force .t.f; event generate .t.f <A>
set x
} -cleanup {
destroy .t.f
@@ -6437,11 +6437,11 @@ 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
@@ -6451,14 +6451,14 @@ 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}
@@ -6469,11 +6469,11 @@ 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
@@ -6484,10 +6484,10 @@ test bind-33.2 {prefer most specific event} -setup {
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
@@ -6498,11 +6498,11 @@ test bind-33.3 {prefer most specific event} -setup {
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 {
@@ -6514,10 +6514,10 @@ test bind-33.4 {prefer most specific event} -setup {
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
@@ -6528,10 +6528,10 @@ test bind-33.5 {prefer most specific event} -setup {
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
@@ -6542,13 +6542,13 @@ test bind-33.6 {prefer most specific event} -setup {
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 {
@@ -6560,9 +6560,9 @@ test bind-33.7 {prefer most specific event} -setup {
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 {
@@ -6574,10 +6574,10 @@ test bind-33.8 {prefer most specific event} -setup {
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 {
@@ -6589,13 +6589,13 @@ test bind-33.9 {prefer last in case of homogeneous equal patterns} -setup {
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
@@ -6606,13 +6606,13 @@ test bind-33.10 {prefer last in case of homogeneous equal patterns} -setup {
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
@@ -6623,17 +6623,17 @@ test bind-33.11 {should prefer most specific} -setup {
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
@@ -6644,10 +6644,10 @@ test bind-33.12 {prefer last in case of homogeneous equal patterns} -setup {
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
@@ -6658,10 +6658,10 @@ test bind-33.13 {prefer last in case of homogeneous equal patterns} -setup {
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-1> { lappend x "first" }
+ bind .t.f <Control-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
@@ -6675,12 +6675,12 @@ test bind-33.14 {prefer last in case of homogeneous equal patterns} -setup {
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
@@ -6691,12 +6691,12 @@ test bind-33.15 {prefer last in case of homogeneous equal patterns} -setup {
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
diff --git a/tests/canvas.test b/tests/canvas.test
index 39643fe..1386208 100644
--- a/tests/canvas.test
+++ b/tests/canvas.test
@@ -574,7 +574,7 @@ test canvas-13.1 {canvas delete during event, SF bug-228024} -body {
set ::x {}
# do this many times to improve chances of triggering the crash
for {set i 0} {$i < 30} {incr i} {
- event generate .c <1> -x 100 -y 100
+ event generate .c <Button-1> -x 100 -y 100
event generate .c <ButtonRelease-1> -x 100 -y 100
}
return $::x
diff --git a/tests/choosedir.test b/tests/choosedir.test
index f67a721..c6cc632 100644
--- a/tests/choosedir.test
+++ b/tests/choosedir.test
@@ -26,7 +26,7 @@ proc ToEnterDirsByKey {parent dirs} {
proc PressButton {btn} {
event generate $btn <Enter>
- event generate $btn <1> -x 5 -y 5
+ event generate $btn <Button-1> -x 5 -y 5
event generate $btn <ButtonRelease-1> -x 5 -y 5
}
@@ -68,7 +68,7 @@ proc SendButtonPress {parent btn type} {
event generate $w <Enter>
focus $w
event generate $button <Enter>
- event generate $w <KeyPress> -keysym Return
+ event generate $w <Key> -keysym Return
}
}
diff --git a/tests/clrpick.test b/tests/clrpick.test
index c15308b..0900962 100644
--- a/tests/clrpick.test
+++ b/tests/clrpick.test
@@ -97,7 +97,7 @@ proc ToChooseColorByKey {parent r g b} {
proc PressButton {btn} {
event generate $btn <Enter>
- event generate $btn <1> -x 5 -y 5
+ event generate $btn <Button-1> -x 5 -y 5
event generate $btn <ButtonRelease-1> -x 5 -y 5
}
@@ -137,7 +137,7 @@ proc SendButtonPress {parent btn type} {
event generate $w <Enter>
focus $w
event generate $button <Enter>
- event generate $w <KeyPress> -keysym Return
+ event generate $w <Key> -keysym Return
}
}
diff --git a/tests/dialog.test b/tests/dialog.test
index 78b6620..2d88103 100644
--- a/tests/dialog.test
+++ b/tests/dialog.test
@@ -25,7 +25,7 @@ test dialog-2.1 {tk_dialog operation} -setup {
update
}
event generate $btn <Enter>
- event generate $btn <1> -x 5 -y 5
+ event generate $btn <Button-1> -x 5 -y 5
event generate $btn <ButtonRelease-1> -x 5 -y 5
}
} -body {
@@ -41,7 +41,7 @@ test dialog-2.2 {tk_dialog operation} -setup {
proc HitReturn {w} {
event generate $w <Enter>
focus -force $w
- event generate $w <KeyPress> -keysym Return
+ event generate $w <Key> -keysym Return
}
} -body {
set x [after 5000 [list set tk::Priv(button) "no response"]]
diff --git a/tests/event.test b/tests/event.test
index 98b877c..b4d2ce9 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -111,7 +111,7 @@ proc _keypress_lookup {char} {
}
}
-# Lookup and generate a pair of KeyPress and KeyRelease events
+# Lookup and generate a pair of Key and KeyRelease events
proc _keypress {win key} {
set keysym [_keypress_lookup $key]
@@ -124,7 +124,7 @@ proc _keypress {win key} {
if {[focus] != $win} {
focus -force $win
}
- event generate $win <KeyPress-$keysym>
+ event generate $win <Key-$keysym>
_pause 50
if {[focus] != $win} {
focus -force $win
@@ -194,10 +194,10 @@ test event-1.1 {Tk_HandleEvent procedure, filter events for dead windows} -setup
update
bind .b <Destroy> {
lappend x destroy
- event generate .b <1>
+ event generate .b <Button-1>
event generate .b <ButtonRelease-1>
}
- bind .b <1> {
+ bind .b <Button-1> {
lappend x button
}
@@ -269,7 +269,7 @@ test event-2.3(keypress) {type into entry widget, triple click, hit Delete key,
event generate $e <Enter>
for {set i 0} {$i < 3} {incr i} {
_pause 100
- event generate $e <ButtonPress-1>
+ event generate $e <Button-1>
_pause 100
event generate $e <ButtonRelease-1>
}
@@ -323,7 +323,7 @@ test event-2.6(keypress) {type into text widget, triple click,
event generate $e <Enter>
for {set i 0} {$i < 3} {incr i} {
_pause 100
- event generate $e <ButtonPress-1>
+ event generate $e <Button-1>
_pause 100
event generate $e <ButtonRelease-1>
}
@@ -355,7 +355,7 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests
# Click down to set the insert cursor position
event generate $e <Enter>
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
# Save the position of the insert cursor
lappend result [$e index insert]
@@ -381,7 +381,7 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests
# Now click and click and drag to the left, over "Tcl/Tk selection"
- event generate $e <ButtonPress-1> -x $current_x -y $current_y
+ event generate $e <Button-1> -x $current_x -y $current_y
while {[$e compare $current >= [list $anchor - 4 char]]} {
foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
@@ -422,7 +422,7 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests
# Click down to set the insert cursor position
event generate $e <Enter>
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
# Save the position of the insert cursor
lappend result [$e index insert]
@@ -448,7 +448,7 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests
# Now click and click and drag to the left, over "Tcl/Tk selection"
- event generate $e <ButtonPress-1> -x $current_x -y $current_y
+ event generate $e <Button-1> -x $current_x -y $current_y
while {$current >= ($anchor - 4)} {
foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
@@ -487,11 +487,11 @@ test event-4.1(double-click-drag) {click down, click up, click down again,
# Click down, release, then click down again
event generate $e <Enter>
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
_pause 50
event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
_pause 50
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
_pause 50
# Save the highlighted text
@@ -558,11 +558,11 @@ test event-4.2(double-click-drag) {click down, click up, click down again,
# Click down, release, then click down again
event generate $e <Enter>
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
_pause 50
event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
_pause 50
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
_pause 50
set result [list]
@@ -630,17 +630,17 @@ test event-5.1(triple-click-drag) {Triple click and drag across lines in a
event generate $e <Enter>
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
_pause 50
event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
_pause 50
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
_pause 50
event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
_pause 50
- event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ event generate $e <Button-1> -x $anchor_x -y $anchor_y
_pause 50
set result [list]
@@ -680,7 +680,7 @@ test event-6.1(button-state) {button press in a window that is then
} -body {
set t [toplevel .t]
- event generate $t <ButtonPress-1>
+ event generate $t <Button-1>
destroy $t
set t [toplevel .t]
set motion nomotion
@@ -719,11 +719,11 @@ test event-7.1(double-click) {A double click on a lone character
# Double click near left hand egde of the letter A
event generate $e <Enter>
- event generate $e <ButtonPress-1> -x $left_x -y $left_y
+ event generate $e <Button-1> -x $left_x -y $left_y
_pause 50
event generate $e <ButtonRelease-1> -x $left_x -y $left_y
_pause 50
- event generate $e <ButtonPress-1> -x $left_x -y $left_y
+ event generate $e <Button-1> -x $left_x -y $left_y
_pause 50
event generate $e <ButtonRelease-1> -x $left_x -y $left_y
_pause 50
@@ -734,18 +734,18 @@ test event-7.1(double-click) {A double click on a lone character
# Clear selection by clicking at 0,0
- event generate $e <ButtonPress-1> -x 0 -y 0
+ event generate $e <Button-1> -x 0 -y 0
_pause 50
event generate $e <ButtonRelease-1> -x 0 -y 0
_pause 50
# Double click near right hand edge of the letter A
- event generate $e <ButtonPress-1> -x $right_x -y $right_y
+ event generate $e <Button-1> -x $right_x -y $right_y
_pause 50
event generate $e <ButtonRelease-1> -x $right_x -y $right_y
_pause 50
- event generate $e <ButtonPress-1> -x $right_x -y $right_y
+ event generate $e <Button-1> -x $right_x -y $right_y
_pause 50
event generate $e <ButtonRelease-1> -x $right_x -y $right_y
_pause 50
@@ -785,11 +785,11 @@ test event-7.2(double-click) {A double click on a lone character
# Double click near left hand egde of the letter A
event generate $e <Enter>
- event generate $e <ButtonPress-1> -x $left_x -y $left_y
+ event generate $e <Button-1> -x $left_x -y $left_y
_pause 50
event generate $e <ButtonRelease-1> -x $left_x -y $left_y
_pause 50
- event generate $e <ButtonPress-1> -x $left_x -y $left_y
+ event generate $e <Button-1> -x $left_x -y $left_y
_pause 50
event generate $e <ButtonRelease-1> -x $left_x -y $left_y
_pause 50
@@ -800,18 +800,18 @@ test event-7.2(double-click) {A double click on a lone character
# Clear selection by clicking at 0,0
- event generate $e <ButtonPress-1> -x 0 -y 0
+ event generate $e <Button-1> -x 0 -y 0
_pause 50
event generate $e <ButtonRelease-1> -x 0 -y 0
_pause 50
# Double click near right hand edge of the letter A
- event generate $e <ButtonPress-1> -x $right_x -y $right_y
+ event generate $e <Button-1> -x $right_x -y $right_y
_pause 50
event generate $e <ButtonRelease-1> -x $right_x -y $right_y
_pause 50
- event generate $e <ButtonPress-1> -x $right_x -y $right_y
+ event generate $e <Button-1> -x $right_x -y $right_y
_pause 50
event generate $e <ButtonRelease-1> -x $right_x -y $right_y
_pause 50
@@ -834,7 +834,7 @@ test event-8 {event generate with keysyms corresponding to
set e [entry $t.e]
pack $e
tkwait visibility $e
- bind $e <KeyPress> {lappend res keycode: %k keysym: %K}
+ bind $e <Key> {lappend res keycode: %k keysym: %K}
focus -force $e
update
event generate $e <diaeresis>
diff --git a/tests/filebox.test b/tests/filebox.test
index e373d73..ee00160 100644
--- a/tests/filebox.test
+++ b/tests/filebox.test
@@ -48,7 +48,7 @@ proc ToEnterFileByKey {parent fileName fileDir} {
proc PressButton {btn} {
event generate $btn <Enter>
- event generate $btn <1> -x 5 -y 5
+ event generate $btn <Button-1> -x 5 -y 5
event generate $btn <ButtonRelease-1> -x 5 -y 5
}
@@ -93,7 +93,7 @@ proc SendButtonPress {parent btn type} {
event generate $w <Enter>
focus $w
event generate $button <Enter>
- event generate $w <KeyPress> -keysym Return
+ event generate $w <Key> -keysym Return
}
}
diff --git a/tests/focus.test b/tests/focus.test
index 73bb9fd..1770427 100644
--- a/tests/focus.test
+++ b/tests/focus.test
@@ -64,7 +64,7 @@ bind all <FocusIn> {
bind all <FocusOut> {
append focusInfo "out %W %d\n"
}
-bind all <KeyPress> {
+bind all <Key> {
append focusInfo "press %W %K"
}
focusSetup
@@ -316,7 +316,7 @@ test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} -constraints {
event gen [testwrapper .t] <FocusIn> -detail NotifyAncestor
set focusInfo {}
set x [focus]
- event gen . <KeyPress-x>
+ event gen . <x>
list $x $focusInfo
} -result {.t.b1 {press .t.b1 x}}
test focus-2.7 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
@@ -617,7 +617,7 @@ test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} -constr
destroy .t
bind all <FocusIn> {}
bind all <FocusOut> {}
-bind all <KeyPress> {}
+bind all <Key> {}
fixfocus
diff --git a/tests/listbox.test b/tests/listbox.test
index 77d75b4..53c51c3 100644
--- a/tests/listbox.test
+++ b/tests/listbox.test
@@ -3156,7 +3156,7 @@ test listbox-31.1 {<<ListboxSelect>> event} -setup {
bind .l <<ListboxSelect>> {lappend res [%W curselection]}
.l insert end a b c
focus -force .l
- event generate .l <1> -x 5 -y 5 ; # <<ListboxSelect>> fires
+ event generate .l <Button-1> -x 5 -y 5 ; # <<ListboxSelect>> fires
.l configure -state disabled
focus -force .l
event generate .l <Control-Home> ; # <<ListboxSelect>> does NOT fire
@@ -3179,7 +3179,7 @@ test listbox-31.2 {<<ListboxSelect>> event on lost selection} -setup {
bind .l <<ListboxSelect>> {lappend res [list [selection own] [%W curselection]]}
.l insert end a b c
focus -force .l
- event generate .l <1> -x 5 -y 5 ; # <<ListboxSelect>> fires
+ event generate .l <Button-1> -x 5 -y 5 ; # <<ListboxSelect>> fires
selection clear ; # <<ListboxSelect>> fires again
update
set res
diff --git a/tests/menu.test b/tests/menu.test
index 4fde53e..5d4884c 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -3949,14 +3949,14 @@ test menu-38.1 {Can't dismiss ttk::menubutton menu until mouse has hovered over
pack .top.mb
update
# simulate mouse click on the menubutton, which posts its menu
- event generate .top.mb <ButtonPress-1> -warp 1
+ event generate .top.mb <Button-1> -warp 1
update
after 50
event generate .top.mb <ButtonRelease-1>
update
# simulate mouse click on the menu again, i.e. without
# entering/leaving the posted menu
- event generate .top.mb <ButtonPress-1>
+ event generate .top.mb <Button-1>
update
after 50
event generate .top.mb <ButtonRelease-1>
diff --git a/tests/msgbox.test b/tests/msgbox.test
index 4a6de57..8fd0dae 100644
--- a/tests/msgbox.test
+++ b/tests/msgbox.test
@@ -94,7 +94,7 @@ proc ChooseMsgByKey {parent btn} {
proc PressButton {btn} {
event generate $btn <Enter>
- event generate $btn <ButtonPress-1> -x 5 -y 5
+ event generate $btn <Button-1> -x 5 -y 5
event generate $btn <ButtonRelease-1> -x 5 -y 5
}
@@ -113,7 +113,7 @@ proc SendEventToMsg {parent btn type} {
event generate $w <Enter>
focus $w
event generate $w.$btn <Enter>
- event generate $w <KeyPress> -keysym Return
+ event generate $w <Key> -keysym Return
}
}
#
diff --git a/tests/scale.test b/tests/scale.test
index 34f2cd9..955092b 100644
--- a/tests/scale.test
+++ b/tests/scale.test
@@ -1364,7 +1364,7 @@ test scale-18.2 {Scale button 1 events [Bug 787065]} -setup {
pack .s
tkwait visibility .s
list [catch {
- event generate .s <1> -x 0 -y 0
+ event generate .s <Button-1> -x 0 -y 0
event generate .s <ButtonRelease-1> -x 0 -y 0
update
set ::error
@@ -1385,7 +1385,7 @@ test scale-18.3 {Scale button 2 events [Bug 787065]} -setup {
pack .s
tkwait visibility .s
list [catch {
- event generate .s <2> -x 0 -y 0
+ event generate .s <Button-2> -x 0 -y 0
event generate .s <ButtonRelease-2> -x 0 -y 0
update
set ::error
@@ -1411,16 +1411,16 @@ test scale-19 {Bug [3529885fff] - Click in through goes in wrong direction} \
} \
-body {
foreach {x y} [.s1 coord 50] {}
- event generate .s1 <1> -x $x -y $y
+ event generate .s1 <Button-1> -x $x -y $y
event generate .s1 <ButtonRelease-1> -x $x -y $y
foreach {x y} [.s2 coord 50] {}
- event generate .s2 <1> -x $x -y $y
+ event generate .s2 <Button-1> -x $x -y $y
event generate .s2 <ButtonRelease-1> -x $x -y $y
foreach {x y} [.s3 coord 50] {}
- event generate .s3 <1> -x $x -y $y
+ event generate .s3 <Button-1> -x $x -y $y
event generate .s3 <ButtonRelease-1> -x $x -y $y
foreach {x y} [.s4 coord 50] {}
- event generate .s4 <1> -x $x -y $y
+ event generate .s4 <Button-1> -x $x -y $y
event generate .s4 <ButtonRelease-1> -x $x -y $y
update
list $x1 $x2 $x3 $x4
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 701aa26..8a9d2c4 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -645,7 +645,7 @@ test scrollbar-8.1 {TkScrollbarEventProc: recursive deletion} notAqua {
.t.f.s set 0 .5
update
set result [winfo exists .t.f.s]
- event generate .t.f.s <ButtonPress> -button 1 -x [expr {[winfo width .t.f.s] / 2}] -y 5
+ event generate .t.f.s <Button> -button 1 -x [expr {[winfo width .t.f.s] / 2}] -y 5
event generate .t <ButtonRelease> -button 1
update
lappend result [winfo exists .t.f.s] [winfo exists .t.f]
@@ -666,7 +666,7 @@ test scrollbar-8.2 {TkScrollbarEventProc: recursive deletion} notAqua {
.t.f.s set 0 .5
update
set result [winfo exists .t.f.s]
- event generate .t.f.s <ButtonPress> -button 1 -x [expr {[winfo width .t.f.s] / 2}] -y 5
+ event generate .t.f.s <Button> -button 1 -x [expr {[winfo width .t.f.s] / 2}] -y 5
event generate .t.f <ButtonRelease> -button 1
update
lappend result [winfo exists .t.f.s] [winfo exists .t.f]
@@ -751,11 +751,11 @@ test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destructi
}
toplevel .top
scrollbar .top.s
- bind .top.s <2> {destroy_scrollbar}
+ bind .top.s <Button-2> {destroy_scrollbar}
pack .top.s
focus -force .top.s
update
- event generate .top.s <2>
+ event generate .top.s <Button-2>
update ; # shall not trigger error invalid command name ".top.s"
} -cleanup {
destroy .top.s .top
@@ -770,11 +770,11 @@ test scrollbar-11.2 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destructi
wm minsize .top 50 400
update
scrollbar .top.s
- bind .top.s <2> {after idle destroy_scrollbar}
+ bind .top.s <Button-2> {after idle destroy_scrollbar}
pack .top.s -expand true -fill y
focus -force .top.s
update
- event generate .top.s <2> -x 2 -y [expr {[winfo height .top.s] / 2}]
+ event generate .top.s <Button-2> -x 2 -y [expr {[winfo height .top.s] / 2}]
update ; # shall not trigger error invalid command name ".top.s"
} -cleanup {
destroy .top.s .top
diff --git a/tests/text.test b/tests/text.test
index ba5b4ff..8019e0d 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6822,14 +6822,14 @@ test text-27.18 {patch 1469210 - inserting after undo} -setup {
} -cleanup {
destroy .t
} -result 1
-test text-27.19 {patch 1669632 (i) - undo after <Control-1>} -setup {
+test text-27.19 {patch 1669632 (i) - undo after <Control-Button-1>} -setup {
destroy .t
} -body {
text .t -undo 1
.t insert end foo\nbar
.t edit reset
.t insert 2.2 WORLD
- event generate .t <Control-1> -x 1 -y 1
+ event generate .t <Control-Button-1> -x 1 -y 1
.t insert insert HELLO
.t edit undo
.t get 2.2 2.7
@@ -6862,7 +6862,7 @@ test text-27.21 {patch 1669632 (vii) - <<Undo>> shall not remove separators} -se
.t insert end "This is an example text"
.t edit reset
.t insert 1.5 "WORLD "
- event generate .t <Control-1> -x 1 -y 1
+ event generate .t <Control-Button-1> -x 1 -y 1
.t insert insert HELLO
event generate .t <<Undo>>
.t insert insert E
@@ -7817,8 +7817,8 @@ test text-36.1 "bug #1777362: event handling with hyphenated windows" -setup {
pack [set w [text .t-1]]
} -body {
tkwait visibility $w
- event generate $w <1>
- event generate $w <1>
+ event generate $w <Button-1>
+ event generate $w <Button-1>
update
set ::my_error
} -cleanup {
@@ -7835,8 +7835,8 @@ test text-36.2 "bug #1777362: event handling with hyphenated windows" -setup {
pack [set w [text .t+1]]
} -body {
tkwait visibility $w
- event generate $w <1>
- event generate $w <1>
+ event generate $w <Button-1>
+ event generate $w <Button-1>
update
set ::my_error
} -cleanup {
@@ -7853,8 +7853,8 @@ test text-36.3 "bug #1777362: event handling with hyphenated windows" -setup {
pack [set w [text .t*1]]
} -body {
tkwait visibility $w
- event generate $w <1>
- event generate $w <1>
+ event generate $w <Button-1>
+ event generate $w <Button-1>
update
set ::my_error
} -cleanup {
diff --git a/tests/textTag.test b/tests/textTag.test
index 35fb18a..0d0d89b 100644
--- a/tests/textTag.test
+++ b/tests/textTag.test
@@ -1261,11 +1261,11 @@ test textTag-15.2 {TkTextBindProc} -setup {
event generate {} <Motion> -warp 1 -x -1 -y -1; update
} -body {
.t tag bind x <Enter> {lappend x x-enter}
- .t tag bind x <ButtonPress> {lappend x x-down}
+ .t tag bind x <Button> {lappend x x-down}
.t tag bind x <ButtonRelease> {lappend x x-up}
.t tag bind x <Leave> {lappend x x-leave}
.t tag bind y <Enter> {lappend x y-enter}
- .t tag bind y <ButtonPress> {lappend x y-down}
+ .t tag bind y <Button> {lappend x y-down}
.t tag bind y <ButtonRelease> {lappend x y-up}
.t tag bind y <Leave> {lappend x y-leave}
event gen .t <Motion> -x 0 -y 0
@@ -1289,12 +1289,12 @@ test textTag-15.3 {TkTextBindProc} -setup {
event generate {} <Motion> -warp 1 -x -1 -y -1; update
} -body {
.t tag bind x <Enter> {lappend x x-enter}
- .t tag bind x <Any-ButtonPress-1> {lappend x x-down}
- .t tag bind x <Any-ButtonRelease-1> {lappend x x-up}
+ .t tag bind x <Button-1> {lappend x x-down}
+ .t tag bind x <ButtonRelease-1> {lappend x x-up}
.t tag bind x <Leave> {lappend x x-leave}
.t tag bind y <Enter> {lappend x y-enter}
- .t tag bind y <Any-ButtonPress-1> {lappend x y-down}
- .t tag bind y <Any-ButtonRelease-1> {lappend x y-up}
+ .t tag bind y <Button-1> {lappend x y-down}
+ .t tag bind y <ButtonRelease-1> {lappend x y-up}
.t tag bind y <Leave> {lappend x y-leave}
event gen .t <Motion> -x 0 -y 0
set x {}
diff --git a/tests/ttk/checkbutton.test b/tests/ttk/checkbutton.test
index 15d365f..5e929de 100644
--- a/tests/ttk/checkbutton.test
+++ b/tests/ttk/checkbutton.test
@@ -56,7 +56,7 @@ test checkbutton-1.7 "Button destroyed by click" -body {
pack .top.mb
focus -force .top.mb
update
- event generate .top.mb <1>
+ event generate .top.mb <Button-1>
event generate .top.mb <ButtonRelease-1>
update ; # shall not trigger error invalid command name ".top.b"
} -result {}
diff --git a/tests/ttk/treetags.test b/tests/ttk/treetags.test
index f91673f..09c34e0 100644
--- a/tests/ttk/treetags.test
+++ b/tests/ttk/treetags.test
@@ -123,28 +123,28 @@ test treetags-1.end "cleanup" -body {
} -result [list [list item1] [list item2] [list]]
test treetags-2.0 "tag bind" -body {
- $tv tag bind tag1 <KeyPress> {set ::KEY %A}
- $tv tag bind tag1 <KeyPress>
+ $tv tag bind tag1 <Key> {set ::KEY %A}
+ $tv tag bind tag1 <Key>
} -cleanup {
treeConstraints $tv
} -result {set ::KEY %A}
test treetags-2.1 "Events delivered to tags" -body {
- focus -force $tv ; update ;# needed so [event generate] delivers KeyPress
+ focus -force $tv ; update ;# needed so [event generate] delivers Key
$tv focus item1
- event generate $tv <KeyPress-a>
+ event generate $tv <a>
set ::KEY
} -cleanup {
treeConstraints $tv
} -result a
test treetags-2.2 "Events delivered to correct tags" -body {
- $tv tag bind tag2 <KeyPress> [list set ::KEY2 %A]
+ $tv tag bind tag2 <Key> [list set ::KEY2 %A]
$tv focus item1
- event generate $tv <KeyPress-b>
+ event generate $tv <b>
$tv focus item2
- event generate $tv <KeyPress-c>
+ event generate $tv <c>
list $::KEY $::KEY2
} -cleanup {
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test
index 65ae55e..270ddf0 100644
--- a/tests/ttk/treeview.test
+++ b/tests/ttk/treeview.test
@@ -645,9 +645,9 @@ test treeview-10.1 "Root node properly initialized (#1541739)" -setup {
test treeview-3006842 "Null bindings" -setup {
ttk::treeview .tv -show tree
} -body {
- .tv tag bind empty <ButtonPress-1> {}
+ .tv tag bind empty <Button-1> {}
.tv insert {} end -text "Click me" -tags empty
- event generate .tv <ButtonPress-1> -x 10 -y 10
+ event generate .tv <Button-1> -x 10 -y 10
.tv tag bind empty
} -result {} -cleanup {
destroy .tv
@@ -682,7 +682,7 @@ test treeview-368fa4561e "indicators cannot be clicked on leafs" -setup {
set res [.tv item foo -open]
# using $h even for x computation is intentional here in order to simulate
# a mouse click on the (invisible since we're on a leaf) indicator
- event generate .tv <ButtonPress-1> \
+ event generate .tv <Button-1> \
-x [expr {$x + $h / 2}] \
-y [expr {$y + $h / 2}]
lappend res [.tv item foo -open]
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index 9fb4c30..53da18a 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -208,8 +208,8 @@ test ttk-2.8 "bug 3223850: button state disabled during click" -setup {
pack [ttk::button .b -command {set ::ttk28 failed}]
update
} -body {
- bind .b <ButtonPress-1> {after 0 {.b configure -state disabled}}
- after 1 {event generate .b <ButtonPress-1>}
+ bind .b <Button-1> {after 0 {.b configure -state disabled}}
+ after 1 {event generate .b <Button-1>}
after 20 {event generate .b <ButtonRelease-1>}
set aid [after 100 {set ::ttk28 [.b instate {disabled !pressed}]}]
vwait ::ttk28
diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test
index 2ebf9c2..c0a5bac 100644
--- a/tests/unixEmbed.test
+++ b/tests/unixEmbed.test
@@ -970,20 +970,20 @@ test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} -constrain
toplevel .t1 -use $w1
}
focus -force .
- bind . <KeyPress> {lappend x {key %A %E}}
+ bind . <Key> {lappend x {key %A %E}}
set x {}
set y [dobg {
update
- bind .t1 <KeyPress> {lappend y {key %A}}
+ bind .t1 <Key> {lappend y {key %A}}
set y {}
- event generate .t1 <KeyPress> -keysym a
+ event generate .t1 <Keys> -keysym a
set y
}]
update
list $x $y
} -cleanup {
deleteWindows
- bind . <KeyPress> {}
+ bind . <Key> {}
} -result {{{key a 1}} {}}
# TkpRedirectKeyEvent is not implemented in win or aqua. If someone
# implements it they should change the constraints for this test.
@@ -1004,13 +1004,13 @@ test unixEmbed-7.1a {TkpRedirectKeyEvent procedure, forward keystroke} -constrai
toplevel .t1 -use [w1]
}
focus -force .
- bind . <KeyPress> {lappend x {key %A %E}}
+ bind . <Key> {lappend x {key %A %E}}
set x {}
set y [slave eval {
update
- bind .t1 <KeyPress> {lappend y {key %A}}
+ bind .t1 <Key> {lappend y {key %A}}
set y {}
- event generate .t1 <KeyPress> -keysym a
+ event generate .t1 <Key> -keysym a
set y
}]
update
@@ -1018,7 +1018,7 @@ test unixEmbed-7.1a {TkpRedirectKeyEvent procedure, forward keystroke} -constrai
} -cleanup {
interp delete slave
deleteWindows
- bind . <KeyPress> {}
+ bind . <Key> {}
} -result {{{key a 1}} {}}
test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} -constraints {
unix notAqua
@@ -1035,20 +1035,20 @@ test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width
update
focus -force .f1
update
- bind . <KeyPress> {lappend x {key %A}}
+ bind . <Key> {lappend x {key %A}}
set x {}
set y [dobg {
update
- bind .t1 <KeyPress> {lappend y {key %A}}
+ bind .t1 <Key> {lappend y {key %A}}
set y {}
- event generate .t1 <KeyPress> -keysym b
+ event generate .t1 <Key> -keysym b
set y
}]
update
list $x $y
} -cleanup {
deleteWindows
- bind . <KeyPress> {}
+ bind . <Key> {}
} -result {{} {{key b}}}
test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke width} -constraints {
unix
@@ -1068,13 +1068,13 @@ test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke widt
update
focus -force .f1
update
- bind . <KeyPress> {lappend x {key %A}}
+ bind . <Key> {lappend x {key %A}}
set x {}
set y [slave eval {
update
- bind .t1 <KeyPress> {lappend y {key %A}}
+ bind .t1 <Key> {lappend y {key %A}}
set y {}
- event generate .t1 <KeyPress> -keysym b
+ event generate .t1 <Key> -keysym b
set y
}]
update
@@ -1082,7 +1082,7 @@ test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke widt
} -cleanup {
interp delete slave
deleteWindows
- bind . <KeyPress> {}
+ bind . <Key> {}
} -result {{} {{key b}}}
test unixEmbed-8.1 {TkpClaimFocus procedure} -constraints {
diff --git a/tests/visual_bb.test b/tests/visual_bb.test
index 030a369..eda67e4 100644
--- a/tests/visual_bb.test
+++ b/tests/visual_bb.test
@@ -94,7 +94,7 @@ test 1.1 {running visual tests} -constraints userInteraction -body {
# Set up for keyboard-based menu traversal
- bind . <Any-FocusIn> {
+ bind . <FocusIn> {
if {("%d" == "NotifyVirtual") && ("%m" == "NotifyNormal")} {
focus .menu
}
@@ -104,7 +104,7 @@ test 1.1 {running visual tests} -constraints userInteraction -body {
# Set up a class binding to allow objects to be deleted from a canvas
# by clicking with mouse button 1:
- bind Canvas <1> {%W delete [%W find closest %x %y]}
+ bind Canvas <Button-1> {%W delete [%W find closest %x %y]}
concat ""
} -result {}
diff --git a/tests/winWm.test b/tests/winWm.test
index d251eb8..0064c5a 100644
--- a/tests/winWm.test
+++ b/tests/winWm.test
@@ -448,7 +448,7 @@ test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constrai
if {![winfo ismapped $w]} { update }
event generate $w <Enter>
focus -force $w
- event generate $w <ButtonPress-1> -x 5 -y 5
+ event generate $w <Button-1> -x 5 -y 5
event generate $w <ButtonRelease-1> -x 5 -y 5
}
proc winwm90proc3 {} {
@@ -492,7 +492,7 @@ test winWm-9.1 "delayed activation of grabbed destroyed window" -constraints win
if {![winfo ismapped $w]} { update }
event generate $w <Enter>
focus -force $w
- event generate $w <ButtonPress-1> -x 5 -y 5
+ event generate $w <Button-1> -x 5 -y 5
event generate $w <ButtonRelease-1> -x 5 -y 5
}
proc winwm91proc3 {} {