Alle has asked for the wisdom of the Perl Monks concerning the following question:
Hi,Monks!
Tk::Text's insert method alwarys buffer my insert string,There's has a demo:
#!/usr/bin/perl -w use strict; use Tk; $| = 1; my $mw = MainWindow->new; my $text = $mw->Text->pack; my $bt = $mw->Button(-text => 'insert', -command => sub {&test_insert})->pack; MainLoop; sub test_insert{ for (1..3){ $text->insert('end', "$_\n"); sleep 1; } }
When I click insert button, the program will wait 3 seconds, then display 1 2 3,. although i set '$| = 1'.I don't want buffer the insert string. I want immediately display insert string every times! Please give me some tips ,thank you!
My Os is windows 7 64bit
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk::Text insert buffer!
by zentara (Cardinal) on Sep 26, 2012 at 11:53 UTC | |
by Alle (Novice) on Sep 26, 2012 at 14:37 UTC | |
by zentara (Cardinal) on Sep 26, 2012 at 15:23 UTC | |
by Alle (Novice) on Sep 26, 2012 at 15:30 UTC |