| Ticket UUID: | fcb1398aa2a817c26e749a6e99d3982238d3bf9b | |||
| Title: | Linux: ttk::menubutton with multi-column cascade is not usable | |||
| Type: | Bug | Version: | 8.6.18, 9.0.5, 9.1.0 | |
| Submitter: | anonymous | Created on: | 2015-12-29 22:03:52 | |
| Subsystem: | 10. Generic Menus | Assigned To: | jan.nijtmans | |
| Priority: | 5 Medium | Severity: | Important | |
| Status: | Closed | Last Modified: | 2026-10-05 12:52:06 | |
| Resolution: | Fixed | Closed By: | jan.nijtmans | |
| Closed on: | 2026-10-05 12:44:21 | |||
| Description: |
With this type of menu, the cascade changes as the mouse is hovered over each selection. But note that the cascade is opened on the far right side of the menu, preventing access by the mouse.
Also note that using menubutton instead of ttk::menubutton does not use the change-on-hover, but change-on-click.
My recommendation would be to add the ability to click on a menu selection, locking that cascade in place. I have always found this type of cascade menu UI with the click-lock very usable.
ttk::menubutton .m -text xxxxx
menu .m.top -tearoff 0
for {set v 1} {$v < 100} {incr v} {
menu .m.top.$v -tearoff 0
foreach {k} [list a b c d e f g ] {
.m.top.$v add command -label $v$k -command {}
}
set c 0
if { $v % 20 == 0 } {
set c 1
}
.m.top add cascade -label $v -menu .m.top.$v \
-columnbreak $c
}
.m configure -menu .m.top
pack .m
Reference: https://groups.google.com/d/msg/comp.lang.tcl/vMucOM_LSE0/X15L6slnDQAJ
| |||
| User Comments: |
jan.nijtmans added on 2026-10-05 12:44:21:
Fixed on [552b623e1e03848b|trunk], and backported to core-9-0-branch and core-8-6-branch Closing. Many thanks! serhiy.storchaka added on 2026-10-05 02:05:08: Thanks. Menus are native on macOS, so the cascade there is not positioned by AdjustMenuCoords(). The test is now X11 only, and renumbered menuDraw-17.4 to not clash with the new menuDraw-17.3 on trunk: [7122be9c96]. jan.nijtmans added on 2026-10-04 21:42:26: I'm seeing this on macOS:
==== menuDraw-17.3 AdjustMenuCoords - multi-column menu [bug fcb1398aa2] FAILED
==== Contents of test case:
menu .m1 -tearoff 0
menu .m2 -tearoff 0
.m2 add command -label foo
.m1 add cascade -label first -menu .m2
.m1 add command -label second -columnbreak 1
.m1 post 100 100
update
.m1 postcascade 0
update
# the cascade is posted at the right edge of the first column
set x [expr {[winfo rootx .m2] - [winfo rootx .m1]}]
expr {[.m1 xposition 0] < $x && $x < [.m1 xposition 1]}
---- Result was:
0
---- Result should have been (exact matching):
1
==== menuDraw-17.3 FAILED
This is exactly the testcase added by the fix branch. serhiy.storchaka added on 2026-09-18 19:09:32: The cascade is posted at the right edge of the whole menu instead of the right edge of its column. Fix in branch [50bd3b589a]. Locking the cascade by click is a separate feature request. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki