in reply to Tk::Stderr flush

Add a delete line to the sub PRINT in Tk::Stderr::Handle:

sub PRINT { my $window = shift; my $text = $$window->Subwidget('text'); $text->delete('0.0', 'end'); # <= Add this line $text->insert('end', $_) foreach (@_); $text->see('end'); $$window->deiconify; $$window->raise; $$window->focus; $$window->update; # ** hacked this line ** - + honyok }

With this line added, each new press of a button writes a message replacing the previous message in the popup window.

Hope that helps,

Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: Tk::Stderr flush
by honyok (Sexton) on Sep 15, 2012 at 22:07 UTC
    Thanks, but that deletes the text every time print is called. I only need to clear the text when the popup window is destroyed. I cannot tell why the data persist when the popup is destroyed, or where it is stored.
    we are the music makers and we are the dreamers of dreams - ww
      Maybe look for "OnDestroy" , all that "privateData" and "DecrementReferenceCount" stuff
        Still trying, still failing ...
        we are the music makers and we are the dreamers of dreams - ww