如何添加动态图片--use Tk;

如何添加动态图片--use Tk;

如何添加动态图片--use Tk;
我的图片是gif格式的,是动态的!

但我运用下面的代码,图片显示是静态的!
请问高手们需要如何改动?!谢谢

use Tk;

my $main = MainWindow->new();
$main->configure(-bg=>"white");

my $start_pic = $main->Photo(-file => './picture/start.gif');

$pic = $main->Label(-image => $start_pic)->pack(-side => "top");

MainLoop;
到现在我还没能研究出来怎.
到现在我还没能研究出来怎么加进去动态图片!!

我还想问,除了Tk,还有没其他模块可以图形化的?!!
呵呵,楼主没认真看书,书.
呵呵,楼主没认真看书,书上就有了。
use Tk;
use Tk::widgets qw/Photo Animation/;
use strict;

my $mw = MainWindow->new;

my $animate;
if (@ARGV) {
$animate = $mw->Animation;
foreach (@ARGV) {
$animate->add_frame($mw->Photo(-file => $_));
}
} else {
my $gif89 = Tk->findINC('anim.gif');
$animate = $mw->Animation(-format => 'gif', -file => $gif89);
}
$animate->set_image(0);

my $lab = $mw->Label(-image => $animate);

my $start = $mw->Button(
-text => 'Start',
-command => [$animate => 'start_animation', 500]);
my $stop = $mw->Button(
-text => 'Stop',
-command => [$animate => 'stop_animation']);
my $quit = $mw->Button(
-text => 'Quit',
-command => \&exit);

$lab->grid(-column => 1, -sticky => 'nsew');
$start->grid($stop, $quit, -sticky => 'ew');
$lab->gridRowconfigure(0,-weight => 1);

MainLoop;
太好了!!----谢谢你.
太好了!!

谢谢你们的帮助!!