summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsurles <surles>1999-03-26 19:37:12 (GMT)
committersurles <surles>1999-03-26 19:37:12 (GMT)
commitc4906b50fb4c6fef28be9c6b2b959ec8b4661952 (patch)
tree7fb94d7c410e27d9faa6d69ea8cee1c93e345f88
parentd1fa234a0baa8e3263d63836441cb4e37916b033 (diff)
downloadtk-c4906b50fb4c6fef28be9c6b2b959ec8b4661952.zip
tk-c4906b50fb4c6fef28be9c6b2b959ec8b4661952.tar.gz
tk-c4906b50fb4c6fef28be9c6b2b959ec8b4661952.tar.bz2
fixed bug in menubutton binding that assumed a menu was attached to the button [Bug 1116]
-rw-r--r--library/menu.tcl5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/menu.tcl b/library/menu.tcl
index 7d91583..447f220 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.1.4.3 1999/02/11 04:13:48 stanton Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.1.4.4 1999/03/26 19:37:12 surles Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -491,8 +491,9 @@ proc tkMbButtonUp w {
global tkPriv
global tcl_platform
+ set menu [$w cget -menu]
set tearoff [expr {($tcl_platform(platform) == "unix") \
- || ([[$w cget -menu] cget -type] == "tearoff")}]
+ || (($menu != {}) && ([ cget -type] == "tearoff"))}]
if {($tearoff != 0) && ($tkPriv(postedMb) == $w)
&& ($tkPriv(inMenubutton) == $w)} {
tkMenuFirstEntry [$tkPriv(postedMb) cget -menu]