For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > December 2004 > look for working fileevent example









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author look for working fileevent example
zymensas

2004-12-07, 4:10 am

perl -v
This is perl, v5.8.4 built for i386-linux-thread-multi

perl -MTk -e 'print $Tk::VERSION."\n"'
800.025

Debian testing

use Tk;

open(H, "tail -f -n 25 $ARGV[0]|") or die "Nope: $!";

$mw = MainWindow->new;
$t = $mw->Text()->pack();
$mw->fileevent(H, 'readable', [\&fill_text_widget, $t]);
MainLoop;

sub fill_text_widget {

my($widget) = @ARG;

$ARG = <H>;
$widget->insert('end', $ARG);
}
this example from faq is not working

tried many ways - nothing happens

Jack D

2004-12-07, 4:10 am

"zymensas" <vytautas@dtiltas.lt> wrote in message
news:1102359957.161816.130110@c13g2000cwb.googlegroups.com...
> perl -v
> This is perl, v5.8.4 built for i386-linux-thread-multi
>
> perl -MTk -e 'print $Tk::VERSION."\n"'
> 800.025
>
> Debian testing
>
> use Tk;
>
> open(H, "tail -f -n 25 $ARGV[0]|") or die "Nope: $!";
>
> $mw = MainWindow->new;
> $t = $mw->Text()->pack();
> $mw->fileevent(H, 'readable', [\&fill_text_widget, $t]);
> MainLoop;
>
> sub fill_text_widget {
>
> my($widget) = @ARG;
>
> $ARG = <H>;
> $widget->insert('end', $ARG);
> }
> this example from faq is not working
>
> tried many ways - nothing happens
>


http://groups.google.ca/groups?selm...telusplanet.net

Jack


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com