Gangabass has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Monks!
I have this code:
#!/usr/bin/perl use strict; use Tkx; my $mw = Tkx::widget->new('.'); $mw->g_wm_minsize( 400, 350 ); my $btn_start = $mw->new_ttk__button( -text => "Start", -width => 60, +-command => sub { start(); } ); my $txt_processed_domains = $mw->new_tk__text( -width => 40, -height = +> 10, -state => "disabled", -wrap => "none" ); Tkx::grid( $btn_start, -row => 2, -columnspan => 3, -padx => 10, -pady + => 10 ); Tkx::grid( $txt_processed_domains, -row => 3, -columnspan => 3, -padx +=> 10, -pady => 10 ); Tkx::MainLoop(); sub start { foreach my $id ( 1.. 10 ) { $txt_processed_domains->configure(-state => "normal"); $txt_processed_domains->insert_end( "$id => Available\n" ); $txt_processed_domains->configure(-state => "disabled"); sleep 1; } Tkx::tk___messageBox( -message => "Completed!" ); }
I need to see which ids are processed but only get whole list at the end. It's like buffering with filehandles but i'm not sure. How to see text in the text box just after inserting it?
Update: I find Tkx::update(); do what i want!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [Tkx] Buffering/Updating issue for text element
by zentara (Cardinal) on Aug 27, 2010 at 11:31 UTC | |
by Gangabass (Vicar) on Aug 28, 2010 at 00:19 UTC | |
by zentara (Cardinal) on Aug 28, 2010 at 11:46 UTC | |
by Anonymous Monk on Aug 28, 2010 at 11:52 UTC | |
by zentara (Cardinal) on Aug 28, 2010 at 12:08 UTC | |
Re: [Tkx] Buffering/Updating issue for text element
by Anonymous Monk on Aug 27, 2010 at 10:05 UTC | |
by Gangabass (Vicar) on Aug 27, 2010 at 10:23 UTC | |
by Anonymous Monk on Aug 27, 2010 at 10:41 UTC |