tags:

views:

16

answers:

2

I have a class called XClient written with the Xt (X Tools Intrinsic library) to setup a multisocketed connection. This XClient class was meant for OSF/Motif GUIs to extend XClient (so the GUI could talk on sockets).

I am trying to migrate into a GTK+ environment which does NOT use the Xt library for portability reasons. Is it still possible to create a wrapper to allow GTK+ use Xt library calls or is that a no no?

A: 

I wouldn't expect Xt and GTK+ to work well or at all in the same process. They are both trying to "own" the X display, the main event loop, etc.

Havoc P
A: 

You should be able to run Xt independently of GTK by calling XtAppInitialize(), which will open its own connection to the X server, which will treat both as independent clients.

You can deal with having a separate event loop by putting the call to XtAppMainLoop() in a separate thread. Just be careful that you don't try to do anything with it from anywhere other than that one thread, because I'm not sure Xt is thread safe. (It may be by now; I haven't had Xt apart in almost 20 years, and it wasn't back then.)

Blrfl