diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-04-09 22:15:18 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-04-09 22:15:18 (GMT) |
commit | 6548122c51d577f37fa75ea3caf6d6ee212d1f11 (patch) | |
tree | 62f0d4501f3c763d072dd488f64a1abe981d82dc /library/menu.tcl | |
parent | 64fab8e25828f5f9bcd76657c7dd7ef39ef57792 (diff) | |
download | tk-6548122c51d577f37fa75ea3caf6d6ee212d1f11.zip tk-6548122c51d577f37fa75ea3caf6d6ee212d1f11.tar.gz tk-6548122c51d577f37fa75ea3caf6d6ee212d1f11.tar.bz2 |
Small patch for menubtton demo on OS X; thanks to Marc Culler
Diffstat (limited to 'library/menu.tcl')
-rw-r--r-- | library/menu.tcl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/library/menu.tcl b/library/menu.tcl index d05740f..cd05207 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -313,6 +313,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] \ @@ -333,6 +336,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] \ |