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

  1. # NOTE: Derived from ..\blib\lib\Tk\Scale.pm.  Changes made here will be lost.
  2. package Tk::Scale;
  3.  
  4. # ControlPress --
  5. # This procedure handles button presses that are made with the Control
  6. # key down. Depending on the mouse position, it adjusts the scale
  7. # value to one end of the range or the other.
  8. #
  9. # Arguments:
  10. # w - The scale widget.
  11. # x, y - Mouse coordinates where the button was pressed.
  12. sub ControlPress
  13. {
  14.  my ($w,$x,$y) = @_;
  15.  my $el = $w->identify($x,$y);
  16.  return unless ($el);
  17.  if ($el eq "trough1")
  18.   {
  19.    $w->set($w->cget("-from"))
  20.   }
  21.  elsif ($el eq "trough2")
  22.   {
  23.    $w->set($w->cget("-to"))
  24.   }
  25. }
  26.  
  27. 1;
  28.