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

  1. # NOTE: Derived from ..\blib\lib\Tk\Scrollbar.pm.  Changes made here will be lost.
  2. package Tk::Scrollbar;
  3.  
  4. # tkScrlTopBottom
  5. # Scroll to the top or bottom of the document, depending on the mouse
  6. # position.
  7. #
  8. # Arguments:
  9. # w -        The scrollbar widget.
  10. # x, y -    Mouse coordinates within the widget.
  11.  
  12. sub ScrlTopBottom 
  13. {
  14.  my $w = shift;
  15.  my $e = $w->XEvent;
  16.  my $element = $w->identify($e->x,$e->y);
  17.  return unless ($element);
  18.  if ($element =~ /1$/)
  19.   {
  20.    $w->ScrlToPos(0);
  21.   }
  22.  elsif ($element =~ /2$/)
  23.   {
  24.    $w->ScrlToPos(1);
  25.   }
  26. }
  27.  
  28. 1;
  29.