in reply to Tk Scrolled widget hairpuller

You should always post a working snippet, or else say it is pseudocode. You have a couple of errors in the script, like Mainloop should be MainLoop. You should always use strict and warnings, which would have told you that.

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__

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Tk Scrolled widget hairpuller
by doojinsi (Novice) on Apr 26, 2005 at 13:46 UTC
    Greetings Monk Zentara, Thank you for the informative and helpful reply. The 'update' statement was the one thing that had eluded me in my copy of O'Reilly Learning Perl/Tk. Adding it per your advice created the desired result. I bow before the gates, Dooj