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

  1. # NOTE: Derived from ..\blib\lib\Tk\Menu.pm.  Changes made here will be lost.
  2. package Tk::Menu;
  3.  
  4. # Escape --
  5. # This procedure is invoked for the Cancel (or Escape) key. It unposts
  6. # the given menu and, if it is the top-level menu for a menu button,
  7. # unposts the menu button as well.
  8. #
  9. # Arguments:
  10. # menu - Name of the menu window.
  11. sub Escape
  12. {
  13.  my $menu = shift;
  14.  if (!$menu->parent->IsMenu)
  15.   {
  16.    $menu->Unpost()
  17.   }
  18.  else
  19.   {
  20.    $menu->LeftRight(-1)
  21.   }
  22. }
  23.  
  24. 1;
  25.