summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2015-02-06 18:08:50 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2015-02-06 18:08:50 (GMT)
commit71c2a6387f19252e7c03d27d70eb457b60c305f5 (patch)
tree4bb67bd300b5d351fca37a85c91cedd70fe225e8 /tests
parent04116ad70993325165bd29ba58336b3e1f9b7415 (diff)
parent15f9a7ce7cb87ba70e1daf57b1a6ec49e266a7b6 (diff)
downloadtk-71c2a6387f19252e7c03d27d70eb457b60c305f5.zip
tk-71c2a6387f19252e7c03d27d70eb457b60c305f5.tar.gz
tk-71c2a6387f19252e7c03d27d70eb457b60c305f5.tar.bz2
Add support for an 'M' binding substitution that is replaced with the number of script-based binding patterns matched so far for the event.
Diffstat (limited to 'tests')
-rw-r--r--tests/bind.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/bind.test b/tests/bind.test
index 85372f8..de9da70 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -25,6 +25,14 @@ proc setup {} {
foreach p [event info] {event delete $p}
update
}
+proc setup2 {} {
+ catch {destroy .b.e}
+ entry .b.e
+ pack .b.e
+ focus -force .b.e
+ foreach p [event info] {event delete $p}
+ update
+}
setup
foreach i [bind Test] {
@@ -1565,6 +1573,24 @@ test bind-16.44 {ExpandPercents procedure} {
event gen .b.f <Gravity>
set x
} {?? ??}
+test bind-16.45 {ExpandPercents procedure} {
+ setup2
+ bind .b.e <Key> {set x "%M"}
+ bind Entry <Key> {set y "%M"}
+ bind all <Key> {set z "%M"}
+ set x none; set y none; set z none
+ event gen .b.e <Key-a>
+ list $x $y $z
+} {0 1 2}
+test bind-16.46 {ExpandPercents procedure} {
+ setup2
+ bind all <Key> {set z "%M"}
+ bind Entry <Key> {set y "%M"}
+ bind .b.e <Key> {set x "%M"}
+ set x none; set y none; set z none
+ event gen .b.e <Key-a>
+ list $x $y $z
+} {0 1 2}
test bind-17.1 {event command} {