Microcebus has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Tk; use Tk::Pane; $mw=MainWindow->new(); $mw->geometry("100x100"); $mw->Button(-text=>"START",-command=>\&start_computation)->pack; MainLoop; sub start_computation { $progress=$mw->Toplevel(); $progress->geometry("200x100"); $pane=$progress->Scrolled('Pane',-scrollbars=>'oe')->pack(-fill=>' +both',-expand=>1); $text="Computation started...\n"; $label=$pane->Label(-text=>$text)->pack(); # doing several computation steps foreach$step(1..10) { sleep(1); $text.="Step $step finished.\n"; $label->configure(-text=>$text); $pane->update; } $text.="\nComputation finished.\n"; $label->configure(-text=>$text); $pane->update; $pane->Button(-text=>"QUIT",-command=>sub{exit;})->pack; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl::Tk Vertical scrollbar on the bottom by default?
by kcott (Archbishop) on Dec 02, 2010 at 11:54 UTC | |
|
Re: Perl::Tk Vertical scrollbar on the bottom by default?
by Tux (Canon) on Dec 02, 2010 at 12:16 UTC |