summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2009-04-10 16:08:45 (GMT)
committerdas <das>2009-04-10 16:08:45 (GMT)
commiteff28bdb2e18fca6c20261e6ec79a53115866075 (patch)
treef7c1d2b4cce0b088c039dce51b2784655f7881de
parent1f20f44fb62a9fa96982a2fbcab1ad8bdfed85a0 (diff)
downloadtk-eff28bdb2e18fca6c20261e6ec79a53115866075.zip
tk-eff28bdb2e18fca6c20261e6ec79a53115866075.tar.gz
tk-eff28bdb2e18fca6c20261e6ec79a53115866075.tar.bz2
* library/menu.tcl (::tk::MbPost): fix error thrown in y position
computation with indicatoron.
-rw-r--r--ChangeLog5
-rw-r--r--library/menu.tcl6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b31e08d..8121365 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-04-10 Daniel Steffen <das@users.sourceforge.net>
+ * library/menu.tcl (::tk::MbPost): fix error thrown in y position
+ computation with indicatoron.
+
+ * generic/tkMenubutton.c: s/DEF_BUTTON_JUSTIFY/DEF_MENUBUTTON_JUSTIFY/
+
* generic/tkBind.c (HandleEventGenerate): ensure window exists before
generating an event for it (fixes testsuite crash).
diff --git a/library/menu.tcl b/library/menu.tcl
index c5b7ca7..b304827 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -4,7 +4,7 @@
# It also implements keyboard traversal of menus and implements a few
# other utility procedures related to menus.
#
-# RCS: @(#) $Id: menu.tcl,v 1.26.2.4 2008/09/09 18:17:08 tmh Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.26.2.5 2009/04/10 16:08:45 das Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -307,7 +307,7 @@ 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 {[$w cget -indicatoron]} {
+ if {[$w cget -indicatoron] && $entry ne ""} {
if {$entry == [$menu index last]} {
incr y [expr {-([$menu yposition $entry] \
+ [winfo reqheight $menu])/2}]
@@ -327,7 +327,7 @@ 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 {[$w cget -indicatoron]} {
+ if {[$w cget -indicatoron] && $entry ne ""} {
if {$entry == [$menu index last]} {
incr y [expr {-([$menu yposition $entry] \
+ [winfo reqheight $menu])/2}]