in reply to (Solved) Perl Tk: STDOUT and STDERR to ROText
If you wanted a random timer interval, you would have to run each timer onetime only, spawning another timer as it's last action.
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); $mw->fontCreate('big', -size => 16 ); my $tx = $mw->Text(-bg=> 'white', -font=>'big', -width => 25)->pack(); tie *STDOUT, 'Tk::Text', $tx; $mw->repeat(1000, \&tick); MainLoop; my $count; sub tick { ++$count; print "$count\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Tk: STDOUT and STDERR to ROText
by Karkadan (Initiate) on Feb 15, 2012 at 20:40 UTC |