in reply to Streaming into tk text widgets
sub conn{ tie *STDOUT, 'Tk::Text',$t; $|++; $sock = new IO::Socket::INET(PeerAddr => 'myhost', PeerPort => '800', Proto => 'tcp'); die unless $sock; # while (defined($buff = <$sock>)){ # print $buff; # } $mw->fileevent($sock, 'readable', [\&fill_text_widget,$t]); } sub fill_text_widget { my($widget) = @_; $_ = <$sock>; $widget->insert('end', $_); $widget->yview('end'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Streaming into tk text widgets
by Scarborough (Hermit) on Oct 18, 2004 at 15:14 UTC |