diff options
author | sbron <sbron@tclcode.com> | 2023-03-30 09:33:43 (GMT) |
---|---|---|
committer | sbron <sbron@tclcode.com> | 2023-03-30 09:33:43 (GMT) |
commit | bc727d6d273e498953e67efaff130d7a9d76ac26 (patch) | |
tree | 3cf0327253e2dff0d9ae663808f20d3c42888f98 /tests | |
parent | 9183585b25cd4a4ec5b1edebba3696dfb8c026e5 (diff) | |
parent | c3a7ccd432c25fc391105311d13c93423ca5771a (diff) | |
download | tk-bc727d6d273e498953e67efaff130d7a9d76ac26.zip tk-bc727d6d273e498953e67efaff130d7a9d76ac26.tar.gz tk-bc727d6d273e498953e67efaff130d7a9d76ac26.tar.bz2 |
Fix [15c685a976]: Issues with menu cloning.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/menu.test | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/menu.test b/tests/menu.test index a4522ee..152d2f4 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -3341,6 +3341,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 |