John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
I'm revisiting this program, and I wonder if now there is something in Perl Tk that does this already, or a more comprehensive module that implements this?
—John# Tie a file handle to a text widget package OutHandle; use Tie::Handle; use vars qw (@ISA); @ISA= ('Tie::Handle'); sub TIEHANDLE { my ($class, $widget)= @_; my $object= \$widget; return bless \$object, $class; #ref to scalar pointing to widget } sub WRITE { my ($this, $s, $len, $offset)= @_; $s= substr ($s, $offset, $len); if ($s eq "\x19") { #End Of Medium control code used to clear screen $$$this->delete ("1.0", 'end'); } else { $$$this->insert ('end', $s); } $$$this -> update; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is there a Perl Tk "console" widget?
by Rich36 (Chaplain) on Nov 21, 2002 at 21:05 UTC | |
by John M. Dlugosz (Monsignor) on Nov 22, 2002 at 15:40 UTC |