in reply to Re: Setting the yview position in scrolled
in thread Setting the yview position in scrolled

Sorry - no go, I also tried with Pane and I get: Tk::Error: Can't call method "Call" on an undefined value at /usr/local/perl5.8.6/lib/site_perl/5.8.6/i686-linux/Tk/Pane.pm line 346, <DATA> line 6.
  • Comment on Re^2: Setting the yview position in scrolled

Replies are listed 'Best First'.
Re^3: Setting the yview position in scrolled
by Anonymous Monk on Jul 18, 2013 at 08:30 UTC
    #!/usr/bin/perl -- use strict; use warnings; use Tk; my $mw = tkinit; my $target = 45; my $tmax = 60; my $bb = $mw->Button( -text => 'JT' )->pack;; my $tt = $mw->Entry( -textvariable => \$target )->pack; my $br = $mw->Button( -text => 'RJ' )->pack;; my $fr = $mw->Scrolled('Frame')->pack; $fr->Button( -text => $_ )->pack for 0 .. $tmax; $bb->configure( -command => [ \&dothat, $fr, \$target, $tmax ] ); $br->configure( -command => [ \&dothat, $fr, \$target, $tmax , 'random +'] ); MainLoop; sub dothat { my( $fr, $tgr, $tm , $random ) = @_; $random and $$tgr = int rand $tm; my $tg = $$tgr / $tm; $fr->yview( moveto => $tg ); return; } __END__
      Thanks - this works

        I know, I wrote it :)

Re^3: Setting the yview position in scrolled
by Anonymous Monk on Jul 18, 2013 at 08:28 UTC
    show your code