okay, this is definitely a Tk or GUI issue, since incorporating a for real "print" (ie. to STDOUT) statement does come out in proper sequence.

Does anyone know if there is a filehandle other than STDOUT for tk requests?

The simplest version of the problem:

use IO::Handle;

sub tmptest {
         STDOUT->autoflush(1);               # $FLT is a text area
         $MW->title("processing...");
         my $data = $FLT->get('1.0','end'); @LData = split(/\n/,$data);
         $FLT->delete('1.0','end');
         foreach (@LData) {
                 my $name = basename($_);
                 print "$_\n"; STDOUT->flush();
                 $FLT->Insert("$name\n");
                 sleep 1;
         }
         $MW->title("...test done");
}

So the "print" line comes out in a background terminal one second at a time...but the Insert and other Tk events happen at the end, simultaneously. In fact, this is exactly the same even without IO::Handle and all the buffering commands.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to