Re: using gtk+ in a child process



On Mon, 13 Oct 2008 09:31:53 +0200
Luka Napotnik <luka napotnik gmail com> wrote:

Hello.

I have a GTK+ program that fork()-s and then in the child process
initializes a GTK+ widget and uses it. Is that a good thing to do or
should I init the GDK subsystem in the fork as well?

Does this work at all in your program - don't you get lots of X
asynchronous errors?

The best thing is to fork before doing anything with GTK+/GDK, and each
can initialise and use GTK+ separately in each process.  You can
communicate between processes using pipes, for example.

If that does not suit what you are doing, then use threads.

Chris




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