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:
parent
f824f26c4f
commit
09813f8e1e
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue