Menu

#2871 Cascade entry stops working if reconfigured with same -menu

obsolete: 8.5.9
open
5
2011-01-06
2011-01-06
No

When a cascade menu entry is reconfigured with its current value for -menu, the
submenu is no longer responsive to mouse actions. The problems seems to be that
the -menu option on the cloned menu gets updated to the non-cloned submenu. The
following code demonstrates the problem:

. configure -menu [menu .menu]
.menu add cascade -label Sub -menu [menu .menu.sub]
.menu.sub add command -label Foo
.menu.sub add command -label Bar
# At this point the submenu works as expected
puts [.#menu entrycget end -menu]
# -> .#menu.#menu#sub
.menu entryconfigure end -menu .menu.sub
puts [.#menu entrycget end -menu]
# -> .menu.sub
# The submenu does not respond to mouse actions.

Linux 2.6.34.7 x86_64 with Tcl/Tk compiled from sources.
I found the problem on Tk 8.5.9, but could reproduce on a fairly recent 8.6b1.2.

This is a different issue from bug #1723059

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.