From c4906b50fb4c6fef28be9c6b2b959ec8b4661952 Mon Sep 17 00:00:00 2001 From: surles Date: Fri, 26 Mar 1999 19:37:12 +0000 Subject: fixed bug in menubutton binding that assumed a menu was attached to the button [Bug 1116] --- library/menu.tcl | 5 +++-- 1 file 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] -- cgit v0.12