...

The question isn't very clear

Its hard to advise what to do without short a runnable program

#!/usr/bin/perl -- ## ## ## perltidy -olq -csc -csci=3 -cscl="sub : BEGIN END if " -otr -opr - +ce -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use Tk; use Time::HiRes qw/ usleep /; Main( @ARGV ); exit( 0 ); sub Main { GoTk( 4 ); GoTk( 8 ); } ## end sub Main sub GoTk { my( $many ) = @_; my $mw = tkinit; my @bbs; for my $one ( 1 .. $many ) { push @bbs, $mw->Button( -text, $one, -command, [ \&bbs_exclusive, ], )- +>pack; } $bbs[ rand @bbs ]->focus; $mw->$_ for qw/ withdraw deiconify raise focusForce update /; $mw->MainLoop; } ## end sub GoTk sub bbs_exclusive { my $ev = $Tk::event; my $bClicked = $Tk::widget; my @bbs = grep { $_->isa( 'Tk::Button' ) } $bClicked->parent- +>children; $_->configure( -state => 'disabled' ) for @bbs; for( 1 .. 10 ) { for my $bb ( @bbs ) { my $t = $bb->cget( -text ); $t .= ' #'; $bb->configure( -text, $t ); $bb->update; } usleep 100 * 1000; # sleep for 100*1 millisecond } for my $bb ( @bbs ) { my $t = $bb->cget( -text ); $t =~ s{(?:\Q #\E)*$}{}; $bb->configure( -text, $t ); $bb->configure( -state, 'normal' ); } } ## end sub bbs_exclusive __END__

In reply to Re: How to freeze a button while it is in active mode by Anonymous Monk
in thread How to freeze a button while it is in active mode by Janish

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.