From fc6c7372de6ac4bf4e5cda274c8d1b211f14a8bb Mon Sep 17 00:00:00 2001 From: tmh Date: Fri, 27 May 2005 18:00:57 +0000 Subject: change tk_popup to have sticky menus --- ChangeLog | 6 ++++++ library/menu.tcl | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44ed717..df317eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-05-27 Todd Helfter + + * library/menu.tcl: correct the sticky behavior of menus posted by + tk_popup so that they "stick" after the initial + following the post, that is not over an active menu entry. + 2005-05-26 Daniel Steffen * macosx/tkMacOSXInit.c (TkpInit): fixed resource file extraction diff --git a/library/menu.tcl b/library/menu.tcl index c6d65bf..5a59c87 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.18.2.1 2004/02/04 00:23:04 hobbs Exp $ +# RCS: @(#) $Id: menu.tcl,v 1.18.2.2 2005/05/27 18:00:59 tmh Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -687,7 +687,10 @@ proc ::tk::MenuInvoke {w buttonRelease} { uplevel #0 [list $w invoke $active] } } else { - MenuUnpost $w + set active [$w index active] + if {$Priv(popup) eq "" || $active ne "none"} { + MenuUnpost $w + } uplevel #0 [list $w invoke active] } } -- cgit v0.12