Re: Generated code is bad how? (WAS: lookup_widget problems)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Well it is bad as not evil but wasteful IMO. It is similar to using Frontpage or
Mozilla Composer, they do end up putting wasted HTML tags. Its not the most
minimal and elegant code possible. Another Point to be noted is that the code
generated is used in a very "functional" way. Its like using functions. But
the power of the Gtk+/Gnome libraries lies in their OOPs architecture which
everyone must use to be a competent programmer in our times. Believe me once 
you start using Gtk+ libraries exploiting their OOPs infrastructure.

And no! It doesn't mean to stop using Glade2. You can use Glade2 to make the
UI's for your windows, dialogs etc and use libglade. That is the preferred way
to go. An example is something I remember from the code produced by Glade1 was
that it gtk_widget_ref all widgets and then gtk_widget_unref'd them. You can 
write Gtk+ code without them. Just bloat.

A thing you might want to consider is that from Glade-3 onwards there will
be no built in C-code generator. All code generators will be external scripts
and/or programs. Glade-3 will only produce the .glade (xml) files. Even the
C code generator will be external like the Perl code generator is right now.

Hope that helps
Archit

Dennis Craven <arker rogers com> writes:

On Wed, 2003-06-11 at 07:22, Mike Hearn wrote:

Of course you should be using libglade anyway rather than generated code
really....

This may be silly, but I don't really know what this means. I've heard
it before in my short stint so far with making GTK apps.

Does this mean that it is a bad thing to use Glade2 period? As in I
shouldn't use the code that is generated to draw and pack the widgets?
Is it done in poor style or something?

I've been working on a small learning project using Glade2 and filling
in the skeleton functions it places in callbacks.c, adding a few myself
etc. These are for the most part one or two line functions that simply
call functions that I've placed in appropriate files so that the file
structure of the project isn't too hard to deal with.

I guess I just don't want to start out on the wrong foot when learning
to program in GTK. I've never really used a GUI (outside curses) and I'd
like to learn it properly. I went through the tutorial on the gtk
website, so I do have an understanding of how it works. I just thought
using Glade would be faster.

Cheers,

Dennis.

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



- -- 
fork() is the Unix programmer's hammer. Because it's available, every problem looks like a nail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard <http://www.gnupg.org/>

iD8DBQE+/02n2rWNPKmGjMcRAgwDAJ9L4rPq5oPKqC+5prip8uu9/dVX9ACdHCam
iXO5AOJQyKdd8F1wbml+k58=
=X6iN
-----END PGP SIGNATURE-----



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