in reply to Re^2: disable button
in thread disable button
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; my $push= $mw->Button(-text => "test ", -command =>[\&save_parms,$mw,'somedata'] )->pack(); MainLoop; sub save_parms { print "@_\n"; my $caller = $Tk::widget; #disable $push $caller->configure(-state=>'disabled'); #do something my $timer = $mw->after(2000,sub{ $caller->configure(-state=>'normal'); #enable $push }); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: disable button
by jdporter (Paladin) on Feb 05, 2009 at 19:21 UTC | |
by zentara (Cardinal) on Feb 05, 2009 at 20:58 UTC |