in reply to How to PopUp a 'Status' window in Perl/Tk
You said that it was sort of a status window, then try progressbar:
use strict; use Tk; use Tk::ProgressBar; my $mw = MainWindow->new; my $top = $mw->Frame()->pack(); my $GoBtn = $top->Button(-text => 'Pop It!', -command => \&AddItem)->p +ack(); my $DoneBtn = $top->Button(-text => ' Exit ', -command => \&Cleanup)-> +pack(); my $progress = $top->ProgressBar( -width => 20, -length => 100, -anchor => 'w', -from => 0, -to => 9, -blocks => 1, -colors => [0, 'green'] )->pack(); $mw->focus; MainLoop; sub Cleanup { $mw->destroy; } sub AddItem { $GoBtn->configure(-state => "disabled"); for (0 .. 9) { sleep 1; $progress->value($_); $progress->update(); } $GoBtn->configure(-state => "normal"); $progress->value(0); $progress->update(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to PopUp a 'Status' window in Perl/Tk
by ozboomer (Friar) on Aug 27, 2005 at 06:05 UTC |