Re: embedding GTK<->Qt: they can, can we ?



Paul Barton-Davis <pbd op net> writes:
> This is from:
> 
>     http://trolls.troll.no/~lars/xparts/doc/xparts.html
> 
>    "Now that we have a dynamically loaded Gtk widget, how do we turn
>     that into a KPart? Quite straight forward. There is a QGtkWidget
>     extension available for Qt, that lets you use Gtk widgets in your
>     Qt applications. You simply create a QGtkWidget with a pointer to
>     the Gtk widget you get from MozEmbed and insert that into your
>     KPart. Then you do a few trivial reimplementations of the virtual
>     functions of the BrowserExtension interface that map to the
>     corresponding functions of Mozilla and you are done. The result is
>     a fully functional Konqueror that uses Mozilla as backend - or
>     rather a fully functional Mozilla that uses Konqueror as graphical
>     user interface, however you want to look at it."
> 
> When, if and how will GTK+ ever be able to wrap other widget sets in
> this way ?
> 

I believe that paper describes out-of-process components. You can
already freely do that with Bonobo, which like KParts is above the
toolkit level. However there is no Bonobo implementation for Qt, just
as there's no KParts implementation for GTK, so the practicality of
all this is pretty limited.

In-process components are more complicated. As they say in the paper,
you have to hack the GLib 1.2 main loop to allow it, and the GLib 2.0
main loop is so hacked out of the box. GTK 2 should work a bit better
with Motif and Qt widgets. We will need GtkXtBin and GtkQtBin widgets
to embed widgets from those toolkits.

Havoc




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