in reply to TK screen problem

If your Tk program is busy doing stuff when you switch to and from another window, then the Tk image will not be re-drawn.

So, as anon suggested, pepper your code with $mw->update() in long loops, or processing sections etc.

For efficiency sake (i.e. don't slow down your program) do NOT

foreach my $i (1..10000) { ... do stuff $mw->update(); }
instead, only update sometimes (every 100 iterations perhaps?)
foreach my $i (1..10000) { ... do stuff if (int($i/100)*100 == $i) { $mw->update(); } }

Replies are listed 'Best First'.
Re^2: TK screen problem
by lostjimmy (Chaplain) on Oct 31, 2008 at 16:18 UTC
    if (int($i/100)*100 == $i) {
    That can be more concisely written as if ($i % 100 == 0) {

      Or:

      unless ($i % 100) {

      :P

      I'm so adjective, I verb nouns!

      chomp; # nom nom nom