From 1582909377203f1252da0be39ad03c84b26717b7 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 9 Apr 2015 22:16:06 +0000 Subject: Small patch for menubtton demo on OS X; thanks to Marc Culler --- library/menu.tcl | 6 ++++++ 1 file changed, 6 insertions(+) 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] \ -- cgit v0.12