in reply to Tk::Error: bad window path name "all"
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();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk::Error: bad window path name "all" ( Scrolled()->Subwidget('scrolled') )
by Anonymous Monk on Nov 05, 2015 at 00:19 UTC |