-command => sub { my $caller_ = $Tk::widget; $caller_->configure(-bg ='red'); $caller_->update; ........................ .....long operation on db $caller_->configure(-bg ='grey'); $caller_->update; }