Re: Can I mix Xlib and Gtk+ in one app?



>
> I've probably spent a lot more time thinking about cross-toolkit
> integration than you imagine. Its a critical and central problem in
> the Linux audio development community in which I am extremely active.
>
> Any time someone wraps a GUI system in a layer that includes an event
> loop, they have created a toolkit that is somewhat inimical to
> integration with other toolkits that include their own event
> loops. There's nothing inherently bad about that - its just a fact of
> this kind of design. Its true on Windows just as much as it is with X
> Window. There are questions about how easy they make it to add new
> entities created using the lowest level of the GUI system (here,
> Xlib). Some toolkits make it impossible (they have no notion of
> foreign windows), some make it possible but fragile (they don't
> properly handle all events delivered to foreign windows) and some
> contain extensive and ugly hacks that make it completely workable
> (such as the KParts integration of GTK+ into KDE apps).
>
> GTK+ (and GDK) mostly fall into the middle category.
>
>      gdk_window_foreign_new()
>
> is a useful helper function to know about. but you will find that, at
> least in GTK+ 1.2, it does not offer perfect integration. it may have
> improved in the 1.3/2.0 series code.
>
> >In fact I have done this with a qt window that I integrated into a motif
> >application last year. It wasn't very hard to do so. I simply had to
> >select the qt controlled windows and dispatch qt events for them.
> >Everything else was done by motif. That worked with just one display.
>
> Then perhaps you should use Qt.
>

I don't like using Qt anymore, since I have to buy very long compile times
for it. It was just an experiment. But it made me aware of another common
property of GUI wrappers. The eventloops they implement are not too hard
to remodel with an own event loop if you just need a defined subset of
features. You often can switch from one event loop to another for some
time and you can learn much about the toolkits in doing so.

Again I have to suggest not only to think about integrating Xlib into gtk
but also to integrate gtk into an Xlib loop or even to integrate both into
completely proprietary loops. Sometimes the effects of such experiments
are quite amazing.

CU INGO





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