diff options
author | tmh <tmh> | 2005-05-27 18:06:26 (GMT) |
---|---|---|
committer | tmh <tmh> | 2005-05-27 18:06:26 (GMT) |
commit | 1c838522c0b377c7567543d50640f9290e506db4 (patch) | |
tree | a0841221f74690762d19c38c2b5e436e13e6d40f | |
parent | 2389c143d1bc1b5400aefcaef26e2e15945a82ad (diff) | |
download | tk-1c838522c0b377c7567543d50640f9290e506db4.zip tk-1c838522c0b377c7567543d50640f9290e506db4.tar.gz tk-1c838522c0b377c7567543d50640f9290e506db4.tar.bz2 |
change tk_popup to have sticky menus
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | library/menu.tcl | 7 |
2 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2005-05-27 Todd Helfter <tmh@users.sourceforge.net> + + * library/menu.tcl: correct the sticky behavior of menus posted by + tk_popup so that they "stick" after the initial <ButtonRelease> + following the post, that is not over an active menu entry. + 2005-05-26 Daniel Steffen <das@users.sourceforge.net> * macosx/tkMacOSXInit.c (TkpInit): fixed resource file extraction diff --git a/library/menu.tcl b/library/menu.tcl index 41c51fd..e8e2f7c 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.20 2004/02/04 00:25:13 hobbs Exp $ +# RCS: @(#) $Id: menu.tcl,v 1.21 2005/05/27 18:06:26 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] } } |