sub PlayAnimation{ my $animation_toplevel = $main::mw->Toplevel; my $img1 = $animation_toplevel->Photo(-file=>$Bin."/MMD/images/spinningpenny.gif"); my $img = $animation_toplevel->Animation(-format => 'gif', -file =>$img1)->start_animation(10); my $anibut = $animation_toplevel->Button(-image=>$img, -command=>sub{print"You pressed me!";})->pack; }