in reply to Tk Scrolled widget hairpuller
Anyways, back to your real question... you need to pack your widgets and update your text widget with each print.
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new; my $tw = $mw->Scrolled ("Text")->pack; my $bu = $mw->Button(-text=>"Go", -command=>\&dosomething)->pack; MainLoop; exit; sub dosomething { for my $i (1 .. 500) { $tw->insert('end',"$i is $i\n" ); $tw->update; $tw->see('end'); select(undef,undef,undef,.1); }; } __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk Scrolled widget hairpuller
by doojinsi (Novice) on Apr 26, 2005 at 13:46 UTC |