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']);