my $scr = new MainWindow; $scr->configure(-background=>"black"); $scr->geometry("500x500"); my $canvas = $scr->Canvas( -background=>"black", -width=>$scr->width, -height=>$scr->height, )->pack( -side=>"left" ); $canvas->Animation('-format' => 'GIF', -file => "tree.gif")->start_animation( 20 );