diff options
author | stanton <stanton> | 1999-05-07 20:05:40 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-05-07 20:05:40 (GMT) |
commit | 179943ecfae06f26341c53dd0da7cc2ea79c33de (patch) | |
tree | 399e7c0f1020231a4b92a6992e6004183519860f | |
parent | 2e7a8273d1d261487eb7c86e24b47e417a1e9009 (diff) | |
download | tk-179943ecfae06f26341c53dd0da7cc2ea79c33de.zip tk-179943ecfae06f26341c53dd0da7cc2ea79c33de.tar.gz tk-179943ecfae06f26341c53dd0da7cc2ea79c33de.tar.bz2 |
* library/menu.tcl: Fixed bug where tk_popup fails when called too
quickly. [Bug: 2009]
-rw-r--r-- | library/menu.tcl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/library/menu.tcl b/library/menu.tcl index 538e330..177de2b 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.5 1999/04/16 01:51:26 stanton Exp $ +# RCS: @(#) $Id: menu.tcl,v 1.6 1999/05/07 20:05:40 stanton Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -555,6 +555,10 @@ proc tkMenuMotion {menu x y state} { proc tkMenuButtonDown menu { global tkPriv global tcl_platform + + if {![winfo viewable $menu]} { + return + } $menu postcascade active if {[string compare $tkPriv(postedMb) ""]} { grab -global $tkPriv(postedMb) @@ -1242,8 +1246,9 @@ proc tk_popup {menu x y {entry {}}} { tkMenuUnpost {} } tkPostOverPoint $menu $x $y $entry - if {![string compare $tcl_platform(platform) "unix"]} { - tkSaveGrabInfo $menu + if {![string compare $tcl_platform(platform) "unix"] \ + && [winfo viewable $menu]} { + tkSaveGrabInfo $menu grab -global $menu set tkPriv(popup) $menu tk_menuSetFocus $menu |