Discussion:
GTK without Glade... any reasons one way or the other?
(too old to reply)
Elf M. Sternberg
2003-11-12 20:59:08 UTC
Permalink
Is there any particular advantage/disadvantage to using Glade to build
your main UI? Most of the projects I use as examples-- Gthumb,
Bluefish, Anjuta-- use glade as an "add-on," but the main UI page seems
to be hand-built. Is there a reason to go one way or the other?

Elf
Geiregat Jonas
2003-11-12 21:08:56 UTC
Permalink
Post by Elf M. Sternberg
Is there any particular advantage/disadvantage to using Glade to build
your main UI? Most of the projects I use as examples-- Gthumb,
Bluefish, Anjuta-- use glade as an "add-on," but the main UI page seems
to be hand-built. Is there a reason to go one way or the other?
Elf
Using glade you can rapidly build gtk based applications, but when
making hand-built gtk applications you have more controle , power
flexibility over your programme.
So glade is good for small things like configurations dialogs, or just
to build a GUI app quickly.
David M. Cook
2003-11-13 10:40:57 UTC
Permalink
Post by Elf M. Sternberg
Is there any particular advantage/disadvantage to using Glade to build
your main UI? Most of the projects I use as examples-- Gthumb,
Bluefish, Anjuta-- use glade as an "add-on," but the main UI page seems
to be hand-built. Is there a reason to go one way or the other?
The advantages for me is a lot less tedium doing layout and making it look
good, and a greater separation between UI and "business objects" (using
libglade). Another advantage to consider is that it is possible for anyone
to tweek the look of the app without touching code, and if you use libglade
this is all dynamic (at least between runs of the program).

Dave Cook
Norman Black
2003-11-13 20:23:24 UTC
Permalink
Have you looked into libGlade. Glade will generate code but libGlade
will load the Glade file at runtime and build your GUI objects. I use
Glade as basically a dialog box resource editor and libGlade to create
those dialogs. It is the easiest way to make GTK have "resources" like
Windows and the Macintosh have.

--
Norman Black
Stony Brook Software
Post by Elf M. Sternberg
Is there any particular advantage/disadvantage to using Glade to build
your main UI? Most of the projects I use as examples-- Gthumb,
Bluefish, Anjuta-- use glade as an "add-on," but the main UI page seems
to be hand-built. Is there a reason to go one way or the other?
Elf
Geiregat Jonas
2003-11-13 20:35:47 UTC
Permalink
Post by Norman Black
Have you looked into libGlade. Glade will generate code but libGlade
will load the Glade file at runtime and build your GUI objects. I use
Glade as basically a dialog box resource editor and libGlade to create
those dialogs. It is the easiest way to make GTK have "resources" like
Windows and the Macintosh have.
--
Norman Black
Stony Brook Software
Post by Elf M. Sternberg
Is there any particular advantage/disadvantage to using Glade to build
your main UI? Most of the projects I use as examples-- Gthumb,
Bluefish, Anjuta-- use glade as an "add-on," but the main UI page
seems
Post by Elf M. Sternberg
to be hand-built. Is there a reason to go one way or the other?
Elf
LibGlade is great but if you don't know gtk learn it by writting it
yourself, if you are capable of doing that you could use glade.
David M. Cook
2003-11-14 10:50:49 UTC
Permalink
Post by Geiregat Jonas
LibGlade is great but if you don't know gtk learn it by writting it
yourself, if you are capable of doing that you could use glade.
Conversely, playing with glade is a good way to learn how gtk does layout.

Dave Cook

Roger Leigh
2003-11-13 23:28:02 UTC
Permalink
Post by Elf M. Sternberg
Is there any particular advantage/disadvantage to using Glade to build
your main UI? Most of the projects I use as examples-- Gthumb,
Bluefish, Anjuta-- use glade as an "add-on," but the main UI page seems
to be hand-built. Is there a reason to go one way or the other?
Plain GTK: total control over the interface, but very tedious
interface construction, since you need to create and pack every widget
manually. It's also hard to maintain.

GTK and Glade: Constructing the interface is simpler, and it's easier
to tweak. In your code, you just pull out the widgets you need to
manipulate from the Glade XML object and use them like normal (using
libglade, rather than C code generation, which is deprecated).

You won't get away from doing things "by hand" with Glade, since
otherwise you wouldn't be able to do anything! You do significantly
reduce the code size, though.


When looking into this, I wrote a small test program using GTK+, GTK+
and Glade, and Gtkmm and Glade. You can find a tutorial and
comparison of the three methods at:
<URL:http://www.whinlatter.uklinux.net/gtk/ogcalc-1.0.0.tar.bz2>.
[may be 1.0.1 now.] FWIW, I use Gtkmm and Glade.
--
Roger Leigh

Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
Continue reading on narkive:
Search results for 'GTK without Glade... any reasons one way or the other?' (Questions and Answers)
4
replies
Best operating system to program on?
started 2011-09-08 03:23:39 UTC
programming & design
Loading...