Canvas->Scale and Tk::Scale conflict?
Quote:
> use Tk;
> use Tk::Canvas;
> #use Tk::Scale;
> # <-- Turn this on to see conflict
> my $main = new MainWindow();
> $c = $main->Scrolled(qw/Canvas -scrollbars se/)->pack();
> $cicle = $c -> createOval(10, 10, 25, 25, -outline=>"red");
> $c->scale( 'all' , 0 , 0 , 8 , 8 );
> MainLoop;
FYI, for core Tk widgets you don't need to use() them. For the Scrolled
widget,
$c references the enclosing frame, so use Subwidget() to get the actual
Canvas
reference:
use Tk;
#use Tk::Canvas;
#use Tk::Scale;
my $main = new MainWindow();
$c = $main->Scrolled(qw/Canvas -scrollbars se/)->pack();
$cicle = $c -> createOval(10, 10, 25, 25, -outline=>"red");
$c->Subwidget('scrolled')->scale( 'all' , 0 , 0 , 8 , 8 );
MainLoop;
What's a core Tk widget? Well, you really don't need to know, and when
Perl/Tk can't find
one of your widgets it tries to autoload it and let's you know via a
warn() message. Then
go ahead and put the use Tk::non-core-widget statement in your code.
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the