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)
commit17a18e1b80f72a1d9384c1c5e41437f7c1d66e23 (patch)
treeab8971dcec76c3497362aa56434fa48380c561ed /library/menu.tcl
parent556b3afd66a938e2a6b864f90cc4dd276cb64658 (diff)
downloadtk-17a18e1b80f72a1d9384c1c5e41437f7c1d66e23.zip
tk-17a18e1b80f72a1d9384c1c5e41437f7c1d66e23.tar.gz
tk-17a18e1b80f72a1d9384c1c5e41437f7c1d66e23.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