A Scrolled object is not the real thing, it's the parent of the real thing.
Mostly, things work properly, but not always.
Get the real canvas and apply ->scale to that:
#!/usr/bin/perl # http://perlmonks.org/?node_id=1146938 use strict; use warnings; use Tk; sub GUI() { my $fenetre = new MainWindow( -title => 'test', ); $fenetre->minsize( 200, 70 ); my $cadre_voie = $fenetre->Frame()->pack(-fill => 'both', -expand +=> 1); my $voie = $cadre_voie->Scrolled( 'Canvas', -background => '#A0A0A0', ); $voie->pack(-fill => 'both', -expand => 1); my $realcanvas = $voie->{SubWidget}{canvas}; $cadre_voie->Scale(-orient=>'horizontal')-> pack(); #$fenetre->repeat( 500, sub { $voie->scale('all',0,0,1,1); } ); $fenetre->repeat( 500, sub { $realcanvas->scale('all',0,0,1,1); } +); MainLoop; # Obligatoire } GUI();
In reply to Re: Tk::Error: bad window path name "all"
by Anonymous Monk
in thread Tk::Error: bad window path name "all"
by topwl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |