in reply to Re^6: convert a single thread application to multithread with GUI
in thread convert a single thread application to multithread with GUI
#!/usr/bin/perl use Tk; use Tk::Text; my $mw=tkinit; my $text = $mw->Scrolled('Text')->pack; $text->bind('<Return>',[sub { &check_limit }]); $mw->Button(-text=>'Press Me', -command=>sub { $text->insert('end',$i++."\n"); $text->see('end'); &check_limit; })->pack; $mw->Button(-text=>'Exit', -command=>sub {exit})->pack; for (1..198){ $text->insert('end',$_."\n"); $text->see('end'); } MainLoop; sub check_limit{ $text->delete('1.0', "end -200 lines"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: convert a single thread application to multithread with GUI
by ultibuzz (Monk) on Jul 12, 2007 at 13:42 UTC | |
by zentara (Cardinal) on Jul 12, 2007 at 16:13 UTC | |
by ultibuzz (Monk) on Jul 12, 2007 at 17:35 UTC |