Running 2 gui libs simultaneously

Brian Van Straalen BVStraalen at lbl.gov
Sat Jul 17 03:14:29 EDT 1999


Guido van Rossum wrote:
> 

> I don't think that's the problem, at least not on Unix.  Each GUI
> package has its own connection (a socket) to the X server, and the X
> server knows which connection to send events to.  No different that
> having two different apps.  If wxWindows exposes the socket and the
> raw event handling function, you can use Tk's createfilehandler to add
> wxWindows's socket to the set of sockets on which it listens (default
> only its own connection to the X server) and in the callback call
> wxWindows's event handler.  Theoretically this should work fine.
> 

Maybe not that easy.  The XServer sends events to ALL widgets that
claim to have a piece of real estate, the event struct also
tells it where that widget is in the 'application hierarchy'.  The 
problem is tk stuff inside a wxWindow, or vice-versa:  BOTH 
UI event loops get the event (handed off to them without
you asking..ha ha).  I had a similar tough time getting
the Java AWT and OpenGL talking to each other a year ago.

Don't remember how I got this working eventually, but
it was platform specific (ungh!, so much for Java).

Brian Van Straalen




More information about the Python-list mailing list