summaryrefslogtreecommitdiffstats
path: root/library/ttk/menubutton.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-06-02 08:31:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-06-02 08:31:12 (GMT)
commitd09859e0c78d355a3c387226452360ef19a20369 (patch)
tree3a4b2d99ce84231471ac07561e45dd0023294788 /library/ttk/menubutton.tcl
parent44720928401709bc3af20910b12e56431c7c064c (diff)
parent5ad56f498e969ec873ccc117e34cebf114e13f59 (diff)
downloadtk-d09859e0c78d355a3c387226452360ef19a20369.zip
tk-d09859e0c78d355a3c387226452360ef19a20369.tar.gz
tk-d09859e0c78d355a3c387226452360ef19a20369.tar.bz2
Merge 8.7
Diffstat (limited to 'library/ttk/menubutton.tcl')
-rw-r--r--library/ttk/menubutton.tcl12
1 files changed, 5 insertions, 7 deletions
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