Posted to tcl by patthoyts at Wed Dec 23 01:06:27 GMT 2009view raw

  1. diff --git a/library/menu.tcl b/library/menu.tcl
  2. index a2d9109..2664d96 100644
  3. --- a/library/menu.tcl
  4. +++ b/library/menu.tcl
  5. @@ -406,6 +406,8 @@ proc ::tk::MenuUnpost menu {
  6. # Unpost menu(s) and restore some stuff that's dependent on
  7. # what was posted.
  8.  
  9. + unset -nocomplain Priv(menuActivated)
  10. +
  11. catch {
  12. if {$mb ne ""} {
  13. set menu [$mb cget -menu]
  14. @@ -557,7 +559,7 @@ proc ::tk::MenuMotion {menu x y state} {
  15. GenerateMenuSelect $menu
  16. }
  17. }
  18. - if {($state & 0x1f00) != 0} {
  19. + if {[info exists Priv(menuActivated)]} {
  20. $menu postcascade active
  21. }
  22. }
  23. @@ -600,6 +602,9 @@ proc ::tk::MenuButtonDown menu {
  24. set Priv(cursor) [$menu cget -cursor]
  25. $menu configure -cursor arrow
  26. }
  27. + if {[$menu type active] eq "cascade"} {
  28. + set Priv(menuActivated) 1
  29. + }
  30. }
  31.  
  32. # Don't update grab information if the grab window isn't changing.