Hi, I want to write a code to hide and show gif image on a click of button. Regards, Jack
#!/usr/bin/perl use strict; use warnings; use Tk::Animation; my $gif = 'C:/wamp/bin/Perl/bin/ajax_loader.gif'; my $mw = MainWindow->new; my $img = $mw->Animation( '-format' => 'gif', '-file' => $gif, ); $mw->Label('-image' => $img)->pack; my $lab = $mw->Label('-text' => "Please wait a moment while we fetch y +our setting information.......")->pack; $img->start_animation(100); my $start = $mw->Button(-text => 'Restart', -command => ['start_animat +ion' => $img, 50])->pack; my $stop = $mw->Button(-text => 'Stop', -command => ['stop_animation' + => $img, $lab='', $img->set_disposal_method(0)])->pack; my $pause = $mw->Button(-text => 'Pause', -command => ['pause_animatio +n' => $img])->pack; my $resume = $mw->Button(-text => 'Resume', -command => ['resume_anima +tion' => $img, 50])->pack; my $ff = $mw->Button(-text => '>>', -command => ['fast_forward' => $im +g,2])->pack; my $fr = $mw->Button(-text => '<<', -command => ['fast_reverse' => $im +g,-2])->pack; my $quit = $mw->Button(-text => 'Quit', -command => [destroy => $mw]) +->pack; $img->set_disposal_method(1); $mw->MainLoop;

In reply to How to hide/show gif on click by jack123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.