> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 19, 2002 4:19 AM > To: [EMAIL PROTECTED] > Subject: another "cute" perl/tk question > > > Ok if I take out the if(){} statement then it will simply > fill the bar... as predicted. However, I wanted to make it go > up and down or affectively "freak out". When I run this > version of the script it just freezes, why? > > #!/usr/bin/perl -w > use Tk; > use Tk::ProgressBar; > use strict; > > my $mainwindow = MainWindow->new(); > $mainwindow->configure(-title => 'Test Text'); > my $position; > my $progressbar = $mainwindow->ProgressBar(-from => 0, -to => > 100, -blocks => 100, -variable => \$position)->pack(); > $mainwindow->Button(-text => 'Freak out', -command => sub{ > insane() })->pack(); > > sub insane { > $position = 0; > while($position != 100) { > if($position == 99) { > $position = 0; > } > $position++;
$mainwindow->update; > } > } > > MainLoop(); > > > > > _______________________________________________ > ActivePerl mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs