开发者

Migration from OSF/Motif & Xt to GTK+

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开发者_StackOverflow中文版 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?


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.


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.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜