$widget->update;
####
use strict;
use Tk;
my $counter = 0;
my $mw = MainWindow->new(-title => "Counter");
$mw->Label(-textvariable => \&runCounter)->pack;
$mw->Button(
-text => 'Start Counter',
-command => \&counter
)->pack;
MainLoop;
sub runCounter {
$counter = 0;
while ($counter != 100000) {
$counter++;
}
}
####
sub runCounter {
$counter = 0;
while ($counter != 100000) {
$counter++;
$mw->idletasks;
}
}
####
sub runCounter {
$counter = 0;
while ($counter != 100000) {
$counter++;
$mw->update;
}
}