in reply to Perl/Tk Message buffering

If you mean buffered messages to the console, then $| is the special variable you're looking for.

If you want text boxes in your gui to update while doing a long operation, then the Tk DoOneEvent() function will help.

Replies are listed 'Best First'.
Re^2: Perl/Tk Message buffering
by martyandpeg (Initiate) on Dec 15, 2010 at 16:21 UTC
    This is a snippet of the code I was referring to. I was just starting to look at DoOneEvent(), but it did not seem to help. if ($progress_count eq '500') { print "Records processed : $record_1_count \n"; $txt -> insert('end',"Records processed : $record_1_count \n"); $progress_count = 0; DoOneEvent(); }
    A mainframe programmer trying to do Perl!

      Note: Use <code></code> tags around your code to keep it legible.

      One single event isn't enough to react to updates and repaint the whole window among responding to all the minor events Windows may throw at your app. Put the DoOneEvent inside the loop you didn't show, rather than the if. That way, you'll interleave small bits of GUI action between record processing, and they'll both share the CPU.

      Also, look up the parameters for DoOneEvent to find the best set of options for your situation. Not waiting if there are no pending events, for example.

      $txt->update
      Cheers, Christoph