summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-04-09 22:16:06 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-04-09 22:16:06 (GMT)
commit8dd8d66fb4be72d7a452936aea3b0ebcb065badd (patch)
treee7526e818b84d453c982613b43087431e01b2cff /library
parent5b1b5e5c9cd743f395389a4e35a1a28d004dcba4 (diff)
downloadtk-8dd8d66fb4be72d7a452936aea3b0ebcb065badd.zip
tk-8dd8d66fb4be72d7a452936aea3b0ebcb065badd.tar.gz
tk-8dd8d66fb4be72d7a452936aea3b0ebcb065badd.tar.bz2
Small patch for menubtton demo on OS X; thanks to Marc Culler
Diffstat (limited to 'library')
-rw-r--r--library/menu.tcl6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/menu.tcl b/library/menu.tcl
index 8b29f00..fd814b3 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -312,6 +312,9 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}]
set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
set entry [MenuFindName $menu [$w cget -text]]
+ if {$entry eq ""} {
+ set entry 0
+ }
if {[$w cget -indicatoron]} {
if {$entry == [$menu index last]} {
incr y [expr {-([$menu yposition $entry] \
@@ -332,6 +335,9 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
set x [expr {[winfo rootx $w] + [winfo width $w]}]
set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
set entry [MenuFindName $menu [$w cget -text]]
+ if {$entry eq ""} {
+ set entry 0
+ }
if {[$w cget -indicatoron]} {
if {$entry == [$menu index last]} {
incr y [expr {-([$menu yposition $entry] \