Re: [gtk-list] gtk or gtk--





I'll send this to the list; it may help others, and it's not a flame.
I know nothing about Qt so won't mention it.

On Sat, 31 Oct 1998, Cyrille Artho wrote:
> I am currently evaluating the benefits of gtk vs gtk-- and (no flames,
> please) qt.
> How many apps use gtk-- compared to gtk?

Most use Gtk+, though this is probably because most of the programmers
prefer C. I won't compare C and C++; that's an off-topic can of worms.
But you should clearly factor it into your decision.

> Is gtk-- evolved enough for
> more complex apps?
> When will the gtk-- tutorial be available?

There is a start on one in CVS I think, but the Gtk+ tutorial basically
applies. It's a very thin wrapper.

> Finally, what can people recommend based on their own experience?

I would use Gtk+ 1.1 series and Gnome in retrospect. Gtk-- has the
following disadvantages right now: 

 - Long compile times. C++ already builds slowly; if you have to 
   build Gtk-- often, that takes a good 20 minutes or half an hour 
   (at least) on my dual PPro with 128 megs; then you have to build
   your own app (Guppi takes another good long while). This is a real
   concern. It genuinely slows down development, especially when gtk--
   is still changing.

 - It is unstable. It often gets out of sync with Gtk, and you have
   to go in and fix it, then rebuild Gtk--, and this is a good way 
   to get distracted from app programming for an hour.

 - The Gnome wrapper is incomplete. The main stuff is there, but it 
   is incomplete; I feel that a pure Gtk+ app is silly at this point,
   with Gnome you can make it *much* nicer with much less effort.
   So you will want to use the Gnome-- wrapper.

 - More instability is probably forthcoming; including changes to the 
   signal system, using a Gdk wrapper for drawing stuff, etc.

 - If your app is free software, it is harder to get people to help 
   you write it if it's in gtk--, because gtk-- is inconvenient 
   for the above reasons.

 - Memory management is kind of weird and hard to keep track of. 
   Increasingly you can use new/delete exclusively, but for 
   a while you'd occasionally get something back from a method
   that needed a g_free(). Containers don't delete their children
   (so you can have the children be class members); widgets can't
   delete themselves due to the "delete this" problem. It's 
   mostly OK but just not-quite-right. And finding a bug 
   like calling delete on a g_malloc'd pointer is hell.

 Of course all of this will be resolved and improved eventually, but 
 if you are on a deadline gtk-- is not yet ready for prime time IMO.
 If you have time tho, it's nice to use gtk-- and help get it ready.
 It is free software after all, so you can fix it when it's broken.

 Gtk-- does have a lot of advantages, however:

 - It is genuinely type-safe at compile time; Gtk+ is runtime type
   safe if you are careful to use g_return_if_fail(GTK_IS_FOO(foo))
   assertions, but it is not quite as good. Gtk+ also has broken
   "const" all over it; there's not even an attempt at widget 
   constness, and the char* correctness is flaky.

 - It has type-safe signal connections, and connections to methods
   (in Gtk+ you can only connect to static functions; so if you 
    write C++, this is kind of annoying). If you define your own
   signals, they are also much faster than native Gtk signals, because
   they don't go through the whole lookup-function-from-string deal.
   You can define signals in any class, not just Gtk_Object descendants. 
   They are really very handy.

 - Works nicely with STL algoritms, C++ string class, etc.

 - It's fairly quick and easy to subclass widgets and write new 
   widgets. Doing this in Gtk+ is a lot of typing and it's
   error prone. Though it's not really hard, it is tedious.

 - Since the widgets are classes, and it's less annoying to create 
   new ones, you can experiment a lot more with your widgets and 
   how they work. It's just a lot less typing if you decide to 
   change what kind of widget to use, or what child widgets a 
   container has, or whatever.

To summarize, Gtk-- will be nice eventually, but I would wait for a stable
version synced with Gtk 1.2. If you need your app now, go for Gtk+.

I'm sure other people can add more comments, but that's a start.

Havoc
 

 
 





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