Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Trying to update a Tk:ROText widget as input is received from a backticked program

by leriksen (Curate)
on Nov 12, 2004 at 02:23 UTC ( #407247=note: print w/ replies, xml ) Need Help??


in reply to Trying to update a Tk:ROText widget as input is received from a backticked program

According to How to display lines to tk text box in real time the update should work. Here's the counter generator from that link

use strict; use Tk; use Tk::ROText; my $main = MainWindow->new; my $b = $main->Button(-text => 'count', -command => \&count )->pack; my $t = $main->ROText(width => 80, height => 10) ->pack(); MainLoop; sub count { my $i = 0; my $count; while ($i<20) { $t->insert("end", "Line $i\n"); $t->update(); sleep 1; $i++; } }
Works on my "This is perl, v5.8.0 built for i386-linux-thread-multi" and "Red Hat Linux release 9 (Shrike)"

Not sure if a process would change that - cant see why, your in the loop with a new value for $_, so should just work. I'll try here to with something like 'cat $0' so I place my own code in the tk window - ok, done - worked fine. Can you give anymore info ? Does the process return any blank lines - they could be hard to see :P

use brain;


Comment on Re: Trying to update a Tk:ROText widget as input is received from a backticked program
Download Code
Re^2: Trying to update a Tk:ROText widget as input is received from a backticked program
by Anonymous Monk on Nov 12, 2004 at 22:06 UTC
    The main difference is $t->update() in this prog. RULE: After insert call update for realtime.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://407247]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2015-07-04 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls