gtk2-perl and fork()'ing



Jens Luedicke writes:
Are there any hints about accessing widgets
from a fork'd part of the program?

You need some sort of protocol through which your sub-process talks to
your main process, and then have the main process talk to the
widgets. The problem is that a fork() leaves both processes with
copies of the same sockets and pipes, so when both of your processes
try to read and write to the same X connection, things quicky get
confused.

However, there's hope: The Gtk2::Helper functions make it really easy
to set up watches in your main app that can read messages from your
child process.

I can't remember if I've attached my gtk2-process-demo to the list
before, so I'll send it directly to you in a separate message. (I'm on
the ferry, without a net connection right now, so I can't check to see
what's in the archives...)

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]