Hi All,
Please help me!
Why doesn't the counter label count in real time in my Tcl/tk Perl
script, though I configure the '$counter' label at all changes
of the "$i" variable.
Thanks: R.
Beci
#!/usr/bin/perl -w
use strict;
use Tk; $|=1; # Create main window
my $main = MainWindow->new; # Add a Label and a Button to main
window
$main->Button( -text => 'Start', -command => sub {progress()} )->pack; my
$counter=$main->Label(
-text=>"0" )->pack(); # Spin the message loop
MainLoop; sub progress {
for my $i (0..15) { sleep(1); $counter->configure(-text=>$i); } } |
- [Perl-unix-users] (no subject) Christopher Terry
- [Perl-unix-users] (no subject) Enrique Vadillo
- [Perl-unix-users] DBFiles in solaris 8: problem! Enrique Vadillo
- [Perl-unix-users] (no subject) Roboz Béla
- [Perl-unix-users] (no subject) John V. Pataki
- RE: [Perl-unix-users] (no subject) Peter Eisengrein
- RE: [Perl-unix-users] (no subject) John V. Pataki
- [Perl-unix-users] (no subject) Vadim K
- RE: [Perl-unix-users] (no subject) Elston, Jeremy
- RE: [Perl-unix-users] (no subject) david . b . deline
- [Perl-unix-users] (no subject) roboz
- [Perl-unix-users] (no subject) Don . Johnson
- [Perl-unix-users] (no subject) stuv48ac
- [Perl-unix-users] (no subject) Charles zhao
- [Perl-unix-users] (no subject) Pasi Valkeila
- Re: [Perl-unix-users] (no subject) $Bill Luebkert
- [Perl-unix-users] (no subject) Rose Reusi-MacLean
- [Perl-unix-users] (no subject) ptornero
- [Perl-unix-users] (no subject) sadanand limaye
- [Perl-unix-users] (no subject) Turczyn, Bill
- [Perl-unix-users] (no subject) PRASANTH M P