[lazarus] GTK or XLib or Whatever

Sebastian Günther sguenther at gmx.de
Mon Jun 28 13:05:00 EDT 1999


"Jerry U. \"Rick\" Dawson" wrote:

> Based upon what I have read, though, it would seem
> that backing down one level to the GDK would be better than backing down
> two levels to the XLIB.

the best would be a component library which can do whatever you want to
do (use GTK, GDK, or just GGI for example)


> 1. Since GTK calls the GDK, is it possible to use a combination of those
> two libraries?

GDK cares about the windows, painting stuff etc.; GTK implements the
widgets.

> Why not look at the implementation of a given GTK widget and
> see how it fails the object model.

GTK uses a quite mighty object model, the only problem is that it is
quite a pain to use, as it doesn't rely on _any_ OOP support inside the
compiler (it is written in C, not in C++).

> Would it be possible to put an object
> wrapper on it that can call the lower level GDK calls or even XLIB calls to
> give the desired results? We do not have to abandon one library in favor of
> another if we can use both.

Of couse you could do that. But it's a lot of work...


> 2. Does the QT have a secondary level as well between it and the XLIB
> similar to GDK? IF so, how different is it from the GDK?

No, not really. Qt/Win32 is build directly on top of the Win32 API, Qt/X
only uses the X libraries and does almost everything for itself. Qt is
quite monolithic.


> 3. Can programs written against the GDK and/or GTK run under KDE?

Yes; even KDE has to use X servers and window managers.


> 4. If it is desired to write against the GTK or the QT, is it possible to
> separate the code out for those libraries so that by flipping a compiler
> switch we could make it a Gnome or a KDE program.

You won't need a compiler switch, instead you will have several
libraries which you can link.


> I read somewhere that the two camps are looking at cooperating on certain
> points, leading to more compatibility between them in the future.

Qt and GTK? The only thing where they will probably corporate are theme
managers; furthermore it is possible that KDE 2.0 and Gnome will share
the same config files.


- Sebastian






More information about the Lazarus mailing list