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

  1. # NOTE: Derived from ..\blib\lib\Tk\Scale.pm.  Changes made here will be lost.
  2. package Tk::Scale;
  3.  
  4. # Activate --
  5. # This procedure is invoked to check a given x-y position in the
  6. # scale and activate the slider if the x-y position falls within
  7. # the slider.
  8. #
  9. # Arguments:
  10. # w - The scale widget.
  11. # x, y - Mouse coordinates.
  12. sub Activate
  13. {
  14.  my $w = shift;
  15.  my $x = shift;
  16.  my $y = shift;
  17.  return if ($w->cget("-state") eq "disabled");
  18.  my $ident = $w->identify($x,$y);
  19.  if (defined($ident) && $ident eq 'slider')
  20.   {
  21.    $w->configure(-state => "active")
  22.   }
  23.  else
  24.   {
  25.    $w->configure(-state => "normal")
  26.   }
  27. }
  28.  
  29. 1;
  30.