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

  1. # NOTE: Derived from ..\blib\lib\Tk\Scale.pm.  Changes made here will be lost.
  2. package Tk::Scale;
  3.  
  4. # Drag --
  5. # This procedure is called when the mouse is dragged with
  6. # mouse button 1 down. If the drag started inside the slider
  7. # (i.e. the scale is active) then the scale's value is adjusted
  8. # to reflect the mouse's position.
  9. #
  10. # Arguments:
  11. # w - The scale widget.
  12. # x, y - Mouse coordinates.
  13. sub Drag
  14. {
  15.  my $w = shift;
  16.  my $x = shift;
  17.  my $y = shift;
  18.  if (!$Tk::dragging)
  19.   {
  20.    return;
  21.   }
  22.  $w->set($w->get($x-$Tk::deltaX,$y-$Tk::deltaY))
  23. }
  24.  
  25. 1;
  26.