summaryrefslogtreecommitdiffstats
path: root/library/menu.tcl
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-11-16 22:54:22 (GMT)
committerhobbs <hobbs>2001-11-16 22:54:22 (GMT)
commitae0485f8991ceffaa4616d14a578ef0c131c6294 (patch)
treeab8971dcec76c3497362aa56434fa48380c561ed /library/menu.tcl
parent9d2acb8a93ada0a565f974faa02dc9ae7d96bf31 (diff)
downloadtk-ae0485f8991ceffaa4616d14a578ef0c131c6294.zip
tk-ae0485f8991ceffaa4616d14a578ef0c131c6294.tar.gz
tk-ae0485f8991ceffaa4616d14a578ef0c131c6294.tar.bz2
* library/menu.tcl: corrected menu traversal code on Unix to
better handle entering cascades. [Patch #481219]
Diffstat (limited to 'library/menu.tcl')
-rw-r--r--library/menu.tcl21
1 files changed, 10 insertions, 11 deletions
diff --git a/library/menu.tcl b/library/menu.tcl
index c9d9c8f..567a306 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.13 2001/08/01 16:21:11 dgp Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.14 2001/11/16 22:54:22 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -780,16 +780,13 @@ proc ::tk::MenuNextMenu {menu direction} {
set count -1
set m2 [winfo parent $menu]
if {[string equal [winfo class $m2] "Menu"]} {
+ $menu activate none
+ GenerateMenuSelect $menu
+ tk_menuSetFocus $m2
+
+ $m2 postcascade none
+
if {[string compare [$m2 cget -type] "menubar"]} {
- $menu activate none
- GenerateMenuSelect $menu
- tk_menuSetFocus $m2
-
- # This code unposts any posted submenu in the parent.
-
- set tmp [$m2 index active]
- $m2 activate none
- $m2 activate $tmp
return
}
}
@@ -885,7 +882,9 @@ proc ::tk::MenuNextEntry {menu count} {
}
$menu activate $i
GenerateMenuSelect $menu
- if {[string equal [$menu type $i] "cascade"]} {
+
+ if {[string equal [$menu type $i] "cascade"] \
+ && [string equal [$menu cget -type] "menubar"]} {
set cascade [$menu entrycget $i -menu]
if {[string compare $cascade ""]} {
# Here we auto-post a cascade. This is necessary when