summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorericm <ericm>2000-03-07 01:02:26 (GMT)
committerericm <ericm>2000-03-07 01:02:26 (GMT)
commit475f34e019d0bc29f1769524e48650375235abf4 (patch)
tree3e1e0d127dc1e46baa4bbc2466cafa52e435cc49 /library
parent253dd7f8bf575cf34521d18f43cc9841c06a747e (diff)
downloadtk-475f34e019d0bc29f1769524e48650375235abf4.zip
tk-475f34e019d0bc29f1769524e48650375235abf4.tar.gz
tk-475f34e019d0bc29f1769524e48650375235abf4.tar.bz2
* library/menu.tcl: Added a check in tkMenuFirstEntry that changes
menu behavior to only auto-post an immediate child cascade if we are currently on a menubar menu. This prevents massive auto-cascading in cases where the first entry of the cascade is itself a cascade, and the first entry of that cascade is a cascade, and the first entry of that cascade is a cascade ... [Bug: 676].
Diffstat (limited to 'library')
-rw-r--r--library/menu.tcl9
1 files changed, 7 insertions, 2 deletions
diff --git a/library/menu.tcl b/library/menu.tcl
index 2c2c751..409955d 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.8 1999/09/02 17:02:52 hobbs Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.9 2000/03/07 01:02:26 ericm Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -1092,7 +1092,12 @@ proc tkMenuFirstEntry menu {
&& [string compare [$menu type $i] "tearoff"]} {
$menu activate $i
tkGenerateMenuSelect $menu
- if {[string equal [$menu type $i] "cascade"]} {
+ # Only post the cascade if the current menu is a menubar;
+ # otherwise, if the first entry of the cascade is a cascade,
+ # we can get an annoying cascading effect resulting in a bunch of
+ # menus getting posted (bug 676)
+ if {[string equal [$menu type $i] "cascade"] && \
+ [string equal [$menu cget -type] "menubar"]} {
set cascade [$menu entrycget $i -menu]
if {[string compare $cascade ""]} {
$menu postcascade $i