summaryrefslogtreecommitdiffstats
path: root/tests/menu.test
diff options
context:
space:
mode:
authorsbron <sbron@tclcode.com>2023-03-30 09:36:58 (GMT)
committersbron <sbron@tclcode.com>2023-03-30 09:36:58 (GMT)
commit818721f59ac0739b02c113eec623a48669b85a1b (patch)
tree13062bc3bc9d6e6f4938e69f801eb3ce863bd46b /tests/menu.test
parentd6d59a6dfd9fc733cf1da68fff8fe730f46532c0 (diff)
parentbc727d6d273e498953e67efaff130d7a9d76ac26 (diff)
downloadtk-818721f59ac0739b02c113eec623a48669b85a1b.zip
tk-818721f59ac0739b02c113eec623a48669b85a1b.tar.gz
tk-818721f59ac0739b02c113eec623a48669b85a1b.tar.bz2
Fix [15c685a976]: Issues with menu cloning.
Diffstat (limited to 'tests/menu.test')
-rw-r--r--tests/menu.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/menu.test b/tests/menu.test
index c18a274..ed40e07 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -3357,6 +3357,58 @@ test menu-20.11 {CloneMenu} -setup {
menu .m2
.m1 clone .m2
} -returnCodes error -result {window name "m2" already exists in parent}
+test menu-20.12 {CloneMenu - copied bindings on empty menu} -setup {
+ deleteWindows
+ set x {}
+} -body {
+ menu .m1 -tearoff 0
+ bind .m1 <<Test>> {append x <<Test>>}
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
+ event generate .m2 <<Test>>
+ return $x
+} -result {<<Test>>}
+test menu-20.13 {CloneMenu - copied bindings on non-empty menu} -setup {
+ deleteWindows
+ set x {}
+} -body {
+ menu .m1 -tearoff 1
+ bind .m1 <<Test>> {append x <<Test>>}
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
+ event generate .m2 <<Test>>
+ return $x
+} -result {<<Test>>}
+test menu-20.14 {CloneMenu - new binding on empty menu} -setup {
+ deleteWindows
+ set x {}
+} -body {
+ menu .m1 -tearoff 0
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
+ bind .m1 <<Test>> {append x <<Test>>}
+ event generate .m2 <<Test>>
+ return $x
+} -result {<<Test>>}
+test menu-20.15 {CloneMenu - new binding on non-empty menu} -setup {
+ deleteWindows
+ set x {}
+} -body {
+ menu .m1 -tearoff 1
+ .m1 clone .m2 tearoff
+ .m2 post 100 100
+ bind .m1 <<Test>> {append x <<Test>>}
+ event generate .m2 <<Test>>
+ return $x
+} -result {<<Test>>}
+test menu-20.16 {CloneMenu - bindtags} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ bindtags .m1 [linsert [bindtags .m1] 1 .m1.sub1]
+ .m1 clone .m2
+ bindtags .m2
+} -result {.m2 .m1 .m1.sub1 Menu all}
test menu-21.1 {MenuDoYPosition} -setup {
deleteWindows