summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorgcramer <remarcg@gmx.net>2018-12-30 16:47:45 (GMT)
committergcramer <remarcg@gmx.net>2018-12-30 16:47:45 (GMT)
commita6cf70af814aabf270732ebbafb7c25201cdf98c (patch)
treecab397cb89ddec1e642b698e997005374ef9f264 /tests
parent99dda22968be2c7054a01ae68198f973d1bb87a8 (diff)
downloadtk-a6cf70af814aabf270732ebbafb7c25201cdf98c.zip
tk-a6cf70af814aabf270732ebbafb7c25201cdf98c.tar.gz
tk-a6cf70af814aabf270732ebbafb7c25201cdf98c.tar.bz2
New test cases added: reset button state after destroying window, and detect when window has changed.
Diffstat (limited to 'tests')
-rw-r--r--tests/bind.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/bind.test b/tests/bind.test
index f7baad0..40ee4d5 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -6310,6 +6310,36 @@ test bind-32.13 {don't detect repetition when window has changed} -setup {
destroy .t.f
destroy .t.g
} -result {A}
+test bind-32.14 {don't detect repetition when window has changed} -setup {
+ pack [frame .t.f]
+ pack [frame .t.g]
+ 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>
+ set x
+} -cleanup {
+ destroy .t.f
+ destroy .t.g
+} -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>
+ 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>
+ destroy .t.f
+ set x
+} -result {1}
test bind-33.1 {prefer longest match} -setup {
pack [frame .t.f]