Re: [gtk-list] Re: I want to understand




On Wed, 14 Apr 1999, Havoc Pennington wrote:

> 
> The reason language bindings are easy to write for Gtk is not that it's
> written in C per se (though that helps some), but rather that it
> implements its own custom object/type/signal system in C. This system is
> extremely flexible; scripting languages can query and alter all sorts of
> things on the fly.  So Gtk already handles a lot of the annoying framework
> you need when dealing with dynamically-typed or garbage collected
> languages, and its object system is flexible enough that you could
> conceivably add new object subclasses written in the other language,
> though not all the bindings support this.

Ah.  This wasn't clear to me.

> 
> Understanding why this is true requires spending a lot of time with
> gtktypeutils.c, gtksignal.c, and gtkobject.c. It's not documented so well.
> guile-gtk has a README that's the closest thing to type system docs.
> I'm not sure I understand it 100%, but if you dig around in that code some
> you'll begin to appreciate it.
> 

Ahem.  Well, I don't know that I'm qualified to do that much digging
around...or sufficiently motivated either.

> You could obviously implement this in C++, since you can implement it in
> C, but the point is that you can't just use the C++ object system, because
> C++ has a static, compile-time object system (for the most part). Since
> you'd be reimplementing an object system anyway, C++ doesn't get you as
> far as you might think.
> 

Point taken.

> Remember: no C/C++ flamewars here. Keep it on-topic about Gtk+. :-)
> 
> Havoc

I'm not starting a flamewar, it's sort of a moot point since GTK+ is
already written.

I AM curious as to why the Gnome people are so key on Obj-C over C++.
Other than NeXTStep programmers, who uses Obj-C?  But I guess that
is off topic here.

As for C++ libraries, QT does exist.  Maybe someday it will even be
GPL and truly free like GTK+ is.  One thing is certain--it is a much
larger and more complicated (but also somewhat more complete) GUI/RAD
tool than GTK+.

On the other hand, I find that GTK+ is a little easier to get a handle
on, i.e. it is more "transparent" as a tool for creating a GUI.  Mind
you, these are initial impressions on small self-tutoring apps.  I don't
have experience writing a major app with either yet.  I have heard
very good things about QT from people who DO write large apps with
it.  Of course, GTK+ is now out in 1.2 flavor, and I understand that there
have been some significant improvements.

Hmmm.  Now that the Kaffe java compiler/VM is integrated into EGCS, I
wonder..will we see GTK+ being used for GUI java interfaces. :)

Inquiring minds are throwing the question out for whoever knows.

****************************************
* J. Mark Brooks, Attorney at Law      *
* P.O. Box 39, Randleman, NC 27317     *
* law.office@jmbrooks.net              *
* ICQ# 33436248                        *
* http://www.jmbrooks.net/law.html     *
****************************************



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