Re: Win32::GUI and Scrolling Text




I need an infite loop. Basically what I'm trying to do is a tail...
reading in entire file and when I get to the end of the file; sleep
for X Seconds and then see if there is any more lines on the end of the
file is unread, else sleep again and repeat.

I don't need to update the window with the entire file, only need to
update the window with the new lines (appeneded at the end of the
buffer).

for example, in a normal text console under Win32 I can do this:


for(;;) {
while ( <FILE> ) {
my $line=$_;
chomp($line);
print ("$line\n");
}
sleep (1);
FILE->clearerr();
}


That reads in entire file, when it gets to end, it sleeps for 1 second.
It then loops back and starts reading where it left off (if there are
any new lines it prints them) then repeats.

I don't need this "event handler loop" stuff getting in my way. I
tried forking it off (so it could run in a differant thread and update
whatever it needs) but that causes the GUI to hang.

I want to control directly what I'm doing or not doing with the file.
It's not the EventHandler's bussiness what I'm doing with this file in
the privacy of my own code.

Can I just do a fork and say "Here Mr. TK GUI, you run in a differant
thread and do whatever you need to do. I'll send you data if I want
you to update something, else stop getting all up in my code like
that".

Basically I want a nice GUI interface with fancy buttons and stuff and
then imbedded in the GUI a window that acts like a "stupid console".

Does that make sense?

Basically I want to do this:
http://tailforwin32.sourceforge.net/

But in Perl.

TK/Win32, I don't care. Just some type of nice GUI interface.

.