diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-03-04 15:41:59 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-03-04 15:41:59 (GMT) |
| commit | 42e3af0d0ae489a65f7f3ce98429a394c0926c32 (patch) | |
| tree | 0149222f25fa8bd0c3a1cb50b3e71a5419cf6021 /tests/bind.test | |
| parent | 3fa224a2450a99a43c66f5f85951bcadb65430c2 (diff) | |
| parent | 2fd9fcf08d73f688888ef8784be0c5493b80d818 (diff) | |
| download | tk-tip_415.zip tk-tip_415.tar.gz tk-tip_415.tar.bz2 | |
merge trunktip_415
Diffstat (limited to 'tests/bind.test')
| -rw-r--r-- | tests/bind.test | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/tests/bind.test b/tests/bind.test index c777d66..474771d 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,48 @@ test bind-16.44 {ExpandPercents procedure} -setup { destroy .t.f } -result {?? ??} +test bind-16.45 {ExpandPercents procedure} -setup { + set savedBind(Entry) [bind Entry <Key>] + set savedBind(All) [bind all <Key>] + 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 + bind all <Key> $savedBind(All) + bind Entry <Key> $savedBind(Entry) + unset savedBind +} -result {0 1 2} +test bind-16.46 {ExpandPercents procedure} -setup { + set savedBind(All) [bind all <Key>] + set savedBind(Entry) [bind Entry <Key>] + 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 + bind Entry <Key> $savedBind(Entry) + bind all <Key> $savedBind(All) + unset savedBind +} -result {0 1 2} test bind-17.1 {event command} -body { event |
