From f24f33c90542b7651835ef2883cd302389178d0d Mon Sep 17 00:00:00 2001 From: stanton Date: Thu, 4 Feb 1999 20:58:40 +0000 Subject: * library/menu.tcl (tkMenuFind): Changed so keyboard shortcuts will only be found in the current toplevel. Previously, they might be found in menus attached to other toplevels that might not even be mapped. [Bug: 924] --- library/menu.tcl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/menu.tcl b/library/menu.tcl index bd18600..ce483ca 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.3 1998/09/14 18:23:23 stanton Exp $ +# RCS: @(#) $Id: menu.tcl,v 1.4 1999/02/04 20:58:40 stanton Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -885,6 +885,10 @@ proc tkMenuFind {w char} { set windowlist [winfo child $w] foreach child $windowlist { + # Don't descend into other toplevels. + if {[winfo toplevel [focus]] != [winfo toplevel $child] } { + continue + } switch [winfo class $child] { Menu { if {[$child cget -type] == "menubar"} { @@ -911,6 +915,10 @@ proc tkMenuFind {w char} { } foreach child $windowlist { + # Don't descend into other toplevels. + if {[winfo toplevel [focus]] != [winfo toplevel $child] } { + continue + } switch [winfo class $child] { Menubutton { set char2 [string index [$child cget -text] \ -- cgit v0.12