in reply to Is there a Perl Tk "console" widget?

There's a simpler way in Tk to do the tie. You specify the filehandle, the widget type and the variable representing the widget. Also, this might be something else worth looking into.

# Tie STDOUT to the ROText box so that the messages to STDOUT appear t +here tie (*STDOUT, 'Tk::ROText', $widget);

«Rich36»

Replies are listed 'Best First'.
Re: Re: Is there a Perl Tk "console" widget?
by John M. Dlugosz (Monsignor) on Nov 22, 2002 at 15:40 UTC
    Hmm, that works...eventually. It doesn't have the equivilent of my $$$this->update on each call to WRITE, so no output shows up until the whole thing is done.

    The tie ability is not mentioned in the Tk::Text or Tk::ROText docs. Where is that discussed? Maybe there's information there about configuring it, too.

    —John Update: I found the PRINT method in Tk::Text.pm and added a call $w->update;. That did the trick. There is no configuration ability in that code.