diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-06-02 08:32:37 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-06-02 08:32:37 (GMT) |
commit | 8e25e6fafcb6b0c452d11db96a0ea30e9dedcdaf (patch) | |
tree | 98cae2788c42aa732b884f6306eaee20f4cde433 /library | |
parent | a1a8abc805d4451c54d6b96f94a3c5db8985ceb2 (diff) | |
parent | d09859e0c78d355a3c387226452360ef19a20369 (diff) | |
download | tk-8e25e6fafcb6b0c452d11db96a0ea30e9dedcdaf.zip tk-8e25e6fafcb6b0c452d11db96a0ea30e9dedcdaf.tar.gz tk-8e25e6fafcb6b0c452d11db96a0ea30e9dedcdaf.tar.bz2 |
Merge enhanced-index
Diffstat (limited to 'library')
-rw-r--r-- | library/listbox.tcl | 2 | ||||
-rw-r--r-- | library/systray.tcl | 7 | ||||
-rw-r--r-- | library/ttk/menubutton.tcl | 12 |
3 files changed, 9 insertions, 12 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl index bb948ff..f0009bf 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -248,7 +248,7 @@ proc ::tk::ListboxMotion {w el} { } extended { set i $Priv(listboxPrev) - if {$i eq ""} { + if {$i < 0} { set i $el $w selection set $el } diff --git a/library/systray.tcl b/library/systray.tcl index 01108cf..931d6a8 100644 --- a/library/systray.tcl +++ b/library/systray.tcl @@ -323,7 +323,6 @@ proc ::tk::sysnotify::sysnotify {title message} { #Add these commands to the tk command ensemble: tk systray, tk sysnotify #Thanks to Christian Gollwitzer for the guidance here -set map [namespace ensemble configure tk -map] -dict set map systray ::tk::systray -dict set map sysnotify ::tk::sysnotify::sysnotify -namespace ensemble configure tk -map $map +namespace ensemble configure tk -map \ + [dict merge [namespace ensemble configure tk -map] \ + {systray ::tk::systray sysnotify ::tk::sysnotify::sysnotify}] diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl index 5809d12..2da6da9 100644 --- a/library/ttk/menubutton.tcl +++ b/library/ttk/menubutton.tcl @@ -83,9 +83,8 @@ if {[tk windowingsystem] eq "aqua"} { set mw [winfo reqwidth $menu] set bw [winfo width $mb] set dF [expr {[winfo width $mb] - [winfo reqwidth $menu] - $menuPad}] - set entry "" set entry [::tk::MenuFindName $menu [$mb cget -text]] - if {$entry eq ""} { + if {$entry < 0} { set entry 0 } set x [winfo rootx $mb] @@ -124,16 +123,15 @@ if {[tk windowingsystem] eq "aqua"} { incr mh 6 incr mw 16 } - set entry {} set entry [::tk::MenuFindName $menu [$mb cget -text]] - if {$entry eq {}} { + if {$entry < 0} { set entry 0 } set x [winfo rootx $mb] set y [winfo rooty $mb] switch [$mb cget -direction] { above { - set entry {} + set entry "" incr y -$mh # if we go offscreen to the top, show as 'below' if {$y < [winfo vrooty $mb]} { @@ -142,7 +140,7 @@ if {[tk windowingsystem] eq "aqua"} { } } below { - set entry {} + set entry "" incr y $bh # if we go offscreen to the bottom, show as 'above' if {($y + $mh) > ([winfo vrooty $mb] + [winfo vrootheight $mb])} { @@ -196,7 +194,7 @@ proc ttk::menubutton::Pulldown {mb} { $mb state pressed $mb configure -cursor [$menu cget -cursor] foreach {x y entry} [PostPosition $mb $menu] { break } - if {$entry ne {}} { + if {$entry >= 0} { $menu post $x $y $entry } else { $menu post $x $y |