diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2015-02-06 20:22:21 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2015-02-06 20:22:21 (GMT) |
commit | 39a45634207ed8bf9c7a943cd0cf9be1b8dc4912 (patch) | |
tree | e82d67b61b40bf61b24a8eed52af49c8b50991ba /tests | |
parent | f22f616575b74a748e0f2057581349a7b412089a (diff) | |
parent | 71c2a6387f19252e7c03d27d70eb457b60c305f5 (diff) | |
download | tk-39a45634207ed8bf9c7a943cd0cf9be1b8dc4912.zip tk-39a45634207ed8bf9c7a943cd0cf9be1b8dc4912.tar.gz tk-39a45634207ed8bf9c7a943cd0cf9be1b8dc4912.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.test | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/bind.test b/tests/bind.test index c777d66..77f944c 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -25,7 +25,6 @@ foreach event [bind all] { bind all $event {} } - proc unsetBindings {} { bind all <Enter> {} bind Test <Enter> {} @@ -2172,6 +2171,38 @@ test bind-16.44 {ExpandPercents procedure} -setup { destroy .t.f } -result {?? ??} +test bind-16.45 {ExpandPercents procedure} -setup { + entry .t.e + pack .t.e + focus -force .t.e + foreach p [event info] {event delete $p} + update +} -body { + bind .t.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 .t.e <Key-a> + list $x $y $z +} -cleanup { + destroy .t.e +} -result {0 1 2} +test bind-16.46 {ExpandPercents procedure} -setup { + entry .t.e + pack .t.e + focus -force .t.e + foreach p [event info] {event delete $p} + update +} -body { + bind all <Key> {set z "%M"} + 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> + list $x $y $z +} -cleanup { + destroy .t.e +} -result {0 1 2} test bind-17.1 {event command} -body { event |