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

  1. # NOTE: Derived from ..\blib\lib\Tk\Menu.pm.  Changes made here will be lost.
  2. package Tk::Menu;
  3.  
  4. # Motion --
  5. # This procedure is called to handle mouse motion events for menus.
  6. # It does two things. First, it resets the active element in the
  7. # menu, if the mouse is over the menu.  Second, if a mouse button
  8. # is down, it posts and unposts cascade entries to match the mouse
  9. # position.
  10. #
  11. # Arguments:
  12. # menu - The menu window.
  13. # y - The y position of the mouse.
  14. # state - Modifier state (tells whether buttons are down).
  15. sub Motion
  16. {
  17.  my $menu = shift;
  18.  my $y = shift;
  19.  my $state = shift;
  20.  if ($menu->IS($Tk::window))
  21.   {
  22.    $menu->activate("\@$y")
  23.   }
  24.  if (($state & 0x1f00) != 0)
  25.   {
  26.    $menu->postcascade("active")
  27.   }
  28. }
  29.  
  30. 1;
  31.