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

  1. # NOTE: Derived from ..\blib\lib\Tk\Scrollbar.pm.  Changes made here will be lost.
  2. package Tk::Scrollbar;
  3.  
  4. # tkScrollEndDrag --
  5. # This procedure is called to end an interactive drag of the slider.
  6. # It scrolls the window if we're in jump mode, otherwise it does nothing.
  7. #
  8. # Arguments:
  9. # w -        The scrollbar widget.
  10. # x, y -    The mouse position at the end of the drag operation.
  11.  
  12. sub EndDrag
  13. {
  14.  my $w = shift;
  15.  my $x = shift;
  16.  my $y = shift;
  17.  return unless defined($initMouse);
  18.  if ($w->cget("-jump"))
  19.   {
  20.    $w->ScrlToPos($initPos + $w->fraction($x,$y) - $initMouse); 
  21.   }
  22.  undef $initMouse;
  23. }
  24.  
  25. 1;
  26.