in reply to Re^2: Tk::Text insert buffer!
in thread Tk::Text insert buffer!
I need display info on text widget immediately after insert method,no buffer,not wait 3 seconds and then display whole info. Can I?
I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
Hi, sure you can. Using your example without the sleep statement:
or you may not be showing the real code you need to use. If you are trying to display something from some other source, and the Text widget isn't displaying it right away, you can try putting a "$mw->update" or a "$text->update" right after your insert statement. This timer may be what you are looking for, otherwise explain in greater detail what you are actually trying to display.#!/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"); } }
#!/usr/bin/perl -w use strict; use Tk; $| = 1; my $mw = MainWindow->new; my $text = $mw->Text->pack; my $repeater = $mw->repeat(1000, \&test_insert); MainLoop; sub test_insert{ $text->insert('end', time."\n"); }
I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Tk::Text insert buffer!
by Alle (Novice) on Sep 26, 2012 at 15:30 UTC |
In Section
Seekers of Perl Wisdom