restrict `menu unpost by click` hack to 8.6+ tcl versions. the hack works on tcl8.4, but lets avoid potential problems on jurassic systems

This commit is contained in:
stefan schippers 2025-01-04 12:47:13 +01:00
parent f824f26c4f
commit 09813f8e1e
1 changed files with 10 additions and 7 deletions

View File

@ -8877,13 +8877,16 @@ if {$text_replace_selection && $OS != "Windows"} {
}
## allow to unpost menu entries when clicking a posted menu
bind Menu <Button> {
if { [%W cget -type] eq "menubar" && [info exists tk::Priv(menuActivated)]} {
%W activate none
} else {
%W activate @%x,%y
}
tk::MenuButtonDown %W
if { [info tclversion] >= 8.6 } {
bind Menu <Button> {
if { [%W cget -type] eq "menubar" && [info exists tk::Priv(menuActivated)]} {
%W activate none
} else {
%W activate @%x,%y
}
tk::MenuButtonDown %W
}
}
## this proc must be called for any created entry widgets