in reply to Tk::Text and buffering, I think

I don't think it has to do with buffering. AFAIK, Perl/Tk has a processing model in which you transfer the control to Tk via the MainLoop function, which in turn calls the callbacks provided by you when some events happen.

Now, when you're in the for loop (which is probably buried inside such a callback), Tk has no way to update the text box until you return from the callback and give control back to it. I'm no expert in Perl/Tk, but you can look for some "interim-update" functions that give control back to Tk temporarily, just to perform this kind of screen updates.

Does it make sense to you?

Update: perusing zentara's answer I noticed that I overlooked the fact that you're using sleeps, which you generally shouldn't for the reasons excellently explained above. OTOH, I hope you were using those sleeps just to explain your point clearly; if those sleeps actually mean "some heavy computation" try anyway to see if there's some interim-update function that you can put inside the computation inself, just to give some feedback ASAP.

Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

Don't fool yourself.

Replies are listed 'Best First'.
Re^2: Tk::Text and buffering, I think
by rvosa (Curate) on May 12, 2005 at 11:15 UTC
    Thanks for the replies, y'all. I should point out that the sleep loop should be taken as "something that takes long"... so not the sleep function per se.