home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / auto / Tk / Menu / Leave.al < prev    next >
Encoding:
Text File  |  1997-08-10  |  818 b   |  29 lines

  1. # NOTE: Derived from ..\blib\lib\Tk\Menu.pm.  Changes made here will be lost.
  2. package Tk::Menu;
  3.  
  4. # Leave --
  5. # This procedure is invoked to handle Leave events for a menu. It
  6. # deactivates everything unless the active element is a cascade element
  7. # and the mouse is now over the submenu.
  8. #
  9. # Arguments:
  10. # menu - The menu window.
  11. # rootx, rooty - Root coordinates of mouse.
  12. # state - Modifier state.
  13. sub Leave
  14. {
  15.  my $menu = shift;
  16.  my $rootx = shift;
  17.  my $rooty = shift;
  18.  my $state = shift;
  19.  my $type;
  20.  undef $Tk::window;
  21.  return if ($menu->index("active") eq "none");
  22.  return if ! defined $menu->Containing($rootx,$rooty);
  23.  return if ($menu->typeIS("active","cascade") && 
  24.             $menu->entrycget("active","-menu")->IS($menu->Containing($rootx,$rooty)));
  25.  $menu->activate("none")
  26. }
  27.  
  28. 1;
  29.