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

  1. # NOTE: Derived from blib\lib\Tk.pm.  Changes made here will be lost.
  2. package Tk;
  3.  
  4. # tkTraverseToMenu --
  5. # This procedure implements keyboard traversal of menus. Given an
  6. # ASCII character "char", it looks for a menubutton with that character
  7. # underlined. If one is found, it posts the menubutton's menu
  8. #
  9. # Arguments:
  10. # w - Window in which the key was typed (selects
  11. # a toplevel window).
  12. # char - Character that selects a menu. The case
  13. # is ignored. If an empty string, nothing
  14. # happens.
  15. sub TraverseToMenu
  16. {
  17.  my $w = shift;
  18.  my $char = shift;
  19.  return unless(defined $char && $char ne "");
  20.  $w = $w->toplevel->FindMenu($char);
  21.  $w->PostFirst() if (defined $w);
  22. }
  23.  
  24. 1;
  25.