From fcc2a1cf19f07f1d0ddf45a86726eef7cd18e2b2 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 27 Nov 2001 14:08:04 +0000 Subject: When a menu is torn off, a new "clone" menu is created which is an exact copy of the original. The copy even includes the tearoff bar, though the tearoff bar is not displayed. But even though it wasn't displayed, the tearoff bar on the tearoff menu could be visited using keyboard traversal. This change makes it so that the (invisible) tearoff bar of tearoff menus is no longer visited on keyboard traversal. --- ChangeLog | 5 +++++ library/menu.tcl | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39a1938..a6656ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-11-27 D. Richard Hipp + + * library/menu.tcl: Do not allow keyboard traversal of torn-off + menus to visit the (invisible) tearoff bar. + 2001-11-26 D. Richard Hipp * win/tkWinMenu.c: disabled menu items show the activebackground diff --git a/library/menu.tcl b/library/menu.tcl index 567a306..5f7352b 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.14 2001/11/16 22:54:22 hobbs Exp $ +# RCS: @(#) $Id: menu.tcl,v 1.15 2001/11/27 14:08:04 drh Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -870,7 +870,9 @@ proc ::tk::MenuNextEntry {menu count} { incr i -$length } if {[catch {$menu entrycget $i -state} state] == 0} { - if {[string compare $state "disabled"]} { + if {$state!="disabled" && + ($i!=0 || [$menu cget -type]!="tearoff" + || [$menu type 0]!="tearoff")} { break } } -- cgit v0.12