home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _471ceea28764162ae25566f0e5dd24fb < prev    next >
Text File  |  2004-06-01  |  939b  |  36 lines

  1. # NOTE: Derived from ..\blib\lib\Tk\Scrollbar.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Scrollbar;
  5.  
  6. #line 376 "..\blib\lib\Tk\Scrollbar.pm (autosplit into ..\blib\lib\auto\Tk\Scrollbar\ScrlToPos.al)"
  7. # tkScrlToPos --
  8. # This procedure tells the scrollbar's associated widget to scroll to
  9. # a particular location, given by a fraction between 0 and 1.  It notifies
  10. # the associated widget in different ways for old and new command syntaxes.
  11. #
  12. # Arguments:
  13. # w -        The scrollbar widget.
  14. # pos -        A fraction between 0 and 1 indicating a desired position
  15. #        in the document.
  16.  
  17. sub ScrlToPos
  18. {
  19.  my $w = shift;
  20.  my $pos = shift;
  21.  my $cmd = $w->cget('-command');
  22.  return unless (defined $cmd);
  23.  my @info = $w->get;
  24.  if (@info == 2)
  25.   {
  26.    $cmd->Call('moveto',$pos);
  27.   }
  28.  else
  29.   {
  30.    $cmd->Call(int($info[0]*$pos));
  31.   }
  32. }
  33.  
  34. # end of Tk::Scrollbar::ScrlToPos
  35. 1;
  36.