On Wed, May 23, 2001 at 07:18:11PM +0100, David Given wrote:
> It's possible for two applications to communicate using the X server
> as an intermediary. For example, this is how tk's send command works.
> I want one program to be able to open the X server, find my GTK
> application, and send it some arbitrary data; this should then arrive
> on the GDK event loop and get passed somehow to my application ---
> probably via a callback. I don't want to use sockets because they only
> work if the two programs are running on the same machine. Since I know
> that the two programs are both using the same X server, it ought to be
> easier to use that X server as the intermediary.
TCP sockets would work, in that case... though I do think I understand
what you mean.
As I understand GTK's event model, there's no facility for recieving
arbitrary X messages. (It's very possible that I'm wrong, but I've
never heard of anything like this and I've been following GTK for a few
years.)
Remember that GTK purports to be at least semi-cross-platform, and is
unlikely to include X-specific code. On top of that, the Python wrapper
to GTK is even less likely to have X-specific code.
> One of the things I want to use this for is to have an engine thread
> doing work in the background. When the work is completed, it can send
> a message to the UI thread telling it where the results are. The
> message arrives on the input queue and is processed with all the other
> X events. Yes, I know I can do this with semaphores and mutexes but
> that restricts me to using a thread in the same process, which may not
> be the case. Besides, I don't know of any way of integrating semaphore
> blocking into the GDK event loop.
Again, a nice use for sockets.
Your engine process doesn't need to connect to the X server.
(And I'm sorry I'm not actually answering your question, but I don't
know a direct answer.)
--
Evan Martin - [EMAIL PROTECTED]
http://www.speakeasy.org/~martine
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk