RE: screen display only updates on callback to text widget

"Bill Mezian" <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
Mike,

Thanks for the speedy response. You were right on the money. The update()
function seems to be what was missing from the docs (or my interpretation of
them).

It was not necessary to update the main window, a call to $t->update() after
a $t->insert worked for the read only text widget in all instances, and for
the progress bar as follows:
$percent_done += 5;
$progress->update();

This would have to carry less overhead than updating the main window and all
embedded widgets.

Thanks again,

All the best,
Bill

-----Original Message-----
From: Michael van Nieuwenhuize [mailto:[email protected]]
Sent: Friday, May 06, 2005 6:18 PM
To: [email protected]; [email protected]
Subject: Re: screen display only updates on callback to text widget


Bill,

The is a update method for your mainwindow.

$mainWindow->update();

When ever you call this method it will update the entire gui. I think each
widget might
also inherit this method. So you may want to try $t->update after each read
to see
if it works. If not you could update mainwindow in your read loop. Not sure
been a while since
I have done any work with text widgets. If I remember correctly update can
eat up resources
so you may have to do some experimentation to see what works best for you.


Regards,

Mike

At 03:01 PM 5/6/2005, Bill Mezian wrote:
>Hello all,
>
>On the Win32 platform using active State 5.8x, I have a program that while
>processing a file, writes updates to a text widget, with processing
>beginning by a command subroutine from a button press:
>
>$f ->Button(-text => "Process New",
>                 -font => 'tahoma 8 bold',
>                 -activebackground => '#D0C36B',
>                 -command => \&process_data_file)
>                 ->pack(-side => 'left', -expand => 1, -fill => 'x', -pady
=>
>1, -anchor => 'w');
>
>The callback to the ROText widget is:
>
>$t->insert("end", "Adding ". $dlrstnum . " " . $year . " " . $make . " " .
>$model . "\n");
>
>called from within a while loop. My problem is this, the screen display
only
>updates after all of the processing has finished, rather than writing each
>line out to the window as it is being processed.
>
>Can anyone help with a suggestion on how to get the screen display to
update
>as the file is processing? The behavior is also the same using a progress
>bar, and output from a ping command to the same text widget.
>
>Thanks for any help!
>
>Bill
>
>-++**==--++**==--++**==--++**==--++**==--++**==--++**==
>This message was posted through the Stanford campus mailing list
>server.  If you wish to unsubscribe from this mailing list, send the
>message body of "unsubscribe ptk" to [email protected]


-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.