Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl/Tk App and Interprocess Communication

by graff (Chancellor)
on Jun 30, 2005 at 02:22 UTC ( [id://471204]=note: print w/replies, xml ) Need Help??


in reply to Perl/Tk App and Interprocess Communication

I can't provide a test/demo snippet, but you might want to look at Tk::After (or Tk::after); it may be possible to set up a repeating event, at some specified msec interval, which will invoke a callback that you specify. This will be affiliated with some particular widget (might as well be "$mainwindow"), and the callback could include something (I forget what, exactly) that will trigger a cycle of the Tk event loop (refreshing all the widgets).

The only thing that might be an issue for you is whether you can set up the file handle that reads from the other perl script so that it does non-blocking i/o. That is, if the "Tk::After" event fires, and your callback goes to the file handle to read from that other script, and that script has not produced any output yet, then your Tk GUI will just "wait" (user activity will be stalled) until something comes in on that file handle -- unless the file handle is set up for non-blocking i/o, in which case, a read will always return immediately (and just not provide any data if there was none available).

That might be the issue that is the basis for the Tk::fileevent limitation to non-MS systems. Good luck.

  • Comment on Re: Perl/Tk App and Interprocess Communication

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-26 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found