summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-03-26 16:35:40 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-03-26 16:35:40 (GMT)
commitc3a7ccd432c25fc391105311d13c93423ca5771a (patch)
tree90e0c07e54e1fb137b5816f99a0f1a3effad08a3 /tests
parent78d9a8d03c9e9e435ad5a38a379addef0b65d636 (diff)
downloadtk-c3a7ccd432c25fc391105311d13c93423ca5771a.zip
tk-c3a7ccd432c25fc391105311d13c93423ca5771a.tar.gz
tk-c3a7ccd432c25fc391105311d13c93423ca5771a.tar.bz2
Make tests 20.12 to -15 pass on Windows. In details: on this platform the cloned menu window does not exist at the time [event generate] is called, which prevents the event from being actually generated. The cloned menu needs to be posted for its window to exist. Then, on Windows, a 'normal' clone posted menu blocks the event loop --> remedy: make the clone of 'tearoff' type when cloning, therefore posting it makes its window exist and does not block the event loop, which in turn allows the event to be generated and serviced.
Diffstat (limited to 'tests')
-rw-r--r--tests/menu.test12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/menu.test b/tests/menu.test
index a27e158..152d2f4 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -3347,7 +3347,8 @@ test menu-20.12 {CloneMenu - copied bindings on empty menu} -setup {
} -body {
menu .m1 -tearoff 0
bind .m1 <<Test>> {append x <<Test>>}
- .m1 clone .m2
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
event generate .m2 <<Test>>
return $x
} -result {<<Test>>}
@@ -3357,7 +3358,8 @@ test menu-20.13 {CloneMenu - copied bindings on non-empty menu} -setup {
} -body {
menu .m1 -tearoff 1
bind .m1 <<Test>> {append x <<Test>>}
- .m1 clone .m2
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
event generate .m2 <<Test>>
return $x
} -result {<<Test>>}
@@ -3366,7 +3368,8 @@ test menu-20.14 {CloneMenu - new binding on empty menu} -setup {
set x {}
} -body {
menu .m1 -tearoff 0
- .m1 clone .m2
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
bind .m1 <<Test>> {append x <<Test>>}
event generate .m2 <<Test>>
return $x
@@ -3376,7 +3379,8 @@ test menu-20.15 {CloneMenu - new binding on non-empty menu} -setup {
set x {}
} -body {
menu .m1 -tearoff 1
- .m1 clone .m2
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
bind .m1 <<Test>> {append x <<Test>>}
event generate .m2 <<Test>>
return $x