Foundations of GTK+ Development: Review
- From: Davyd Madeley <davyd madeley id au>
- To: gnome-journal-list gnome org
- Subject: Foundations of GTK+ Development: Review
- Date: Sat, 11 Aug 2007 14:48:03 +0800
Ok, so I'm now 10 days late in submitting this, and I'm still not happy
with it, but here it is.
It's undoubtedly full of grammatical, because I've not taken much care
in writing it (I feel like my writing of late has been stylistically
pretty shit anyway). Perhaps one of our skilled editors can knock it
into shape.
Certainly don't even think of publishing it until someone's given it a
good scrubbing (even if I have to take it back and try again).
I'll do up some images of a foot, a hollow foot and a half hollow foot
later on so that we can reuse them.
--davyd
Checked for Virus & Spam by West Australian Networks Internet Service Providers see www.westnet.net.au
Review: Foundations of GTK+ Development
=======================================
There aren't many books available that cover GTK+ and even fewer of them are up to date. For a long time, the only book covering GTK+ 2.0 was Matthias Warkus'
__The Official GNOME 2 Developer's Guide__ from No Starch Press. Now Andrew
Krause, a computer engineering student from Pennsylvania State University,
has written __Foundations of GTK+ Development__, published by Apress. Krause
was very kind in providing me with a complementry copy to review.
While by no means the heaviest book on my shelf, __Foundations of GTK+
Development__ weighs in at 630 pages with 13 chapters and 6 appendicies.
Krause has the right idea with his chapters. The book first covers
terminology and what you need to develop GTK+ programs. The second chapter
then gives the archetypical "hello world" example, important for the budding
GTK+ developer to feel a sense of accomplishment. It introduces the
fundamental concepts of GTK+: events, the mainloop, signals and widget
heirachies. Chapters 3-5 cover a wide
range of GTK+ widgets, starting with packing containers (and how box packing
works in GTK+), many of the common
widgets you see day to day and finally dialogs. Chapter 6 touches on the
functionality provided in GLib. Chapters 7 and 8 cover GtkTextView and
GtkTreeView respectively. 9 is menus and toolbars and 10 covers Glade.
Chapter 11 briefly touches on writing custom GTK+ widgets and chapter 12 cleans
up any miscellaneous items. Chapter 13 then looks at some example apps to
discuss how they work.
The book starts with a reasonable overview of X11, GTK+ and its main
components (GLib, GObject, GDK, Pango and ATK, but not Cairo) and makes
mention of the language bindings. Though be warned, while the bindings are
mentioned, this is very much a book for C programmers, and those who are
working with a language binding may find it of only minimal usefulness.
Krause attempts to explain how to get GTK+ development packages from
your vendor or how to build and install them yourself, but I don't believe
it covers this in
enough detail. There is neither a discussion of what packages to install or
what the set of packages you will need to build are called. Prospective
developers will find it confusing to set up their environment and will likely
require extra help.
Krause takes the time to provide some words of caution to the unwary
beginning, for example with regards to widget layout, and references the Human
Interface Guidelines and handful of times when discussing the design of user
interfaces as well as providing his own advice.
Chapter 11 covers writing a custom widget, but I personally found this chapter
to be a little bit disappointing as it seems to diverge from GTK+ best
practice. For example, it doesn't use G_DEFINE_TYPE(), or consistently
demonstrate functionality like GLib's runtime type checking for public
functions. In my opinion, __The Official GNOME2 Developer's Guide__ contains
a better treatment of GObject, although it doesn't cover creating custom
widgets. The
drawing functions described in this chapter are the old GDK drawing functions
rather than the Cairo drawing API. Cairo is instead briefly covered in the
next chapter under Additional GTK+ Widgets after GtkPrint.
Krause comprehensively covers most, if not all, of the UI widgets available in
GTK+, along with an excellent chapter detailing most of the features and data
structures provided by GLib.
Unfortunately the book does not spend much time
discussing GTK+ best practices nor does it provide canonical design patterns
for some of the widgets (e.g., GtkRadioButton, a widget that many
inexperienced GTK+ programmers get confused by). The book covers Glade
(version 3.0) and libglade, but does not cover libgnome/ui, GConf, GnomeVFS,
libmlx2 or
other GNOME-related technologies (which are covered in __The Official GNOME2
Developer's Guide__).
I like the //Test Your Understanding// section given at the end of each
chapter. These sections present small exercises to the reader that allows him
or her to put what they've read into practice (e.g. connecting a signal or
creating a menu). Brief answers to these exercises are provided in the back of
the book with source code available on the Web. Each chapter also ends with a
summary of what was in the chapter.
The last chapter of the book discusses the construction of several small
sample applications: a simple file browser, a calculator, a hangman game, a
wrapper around `ping` and a calendar. Hints are provided for each application
so that the reader can attempt to implement the utility him/herself, although
sourcecode is provided on the Web. The chapter then suggests where to go for
further help. 5 of the 6 appendicies are GTK+ reference documentation:
properties, signals, styles, Pango markup, stock items and GError types.
Unfortunately the book never points budding developers to awesome tools like
Devhelp.
The publisher, Apress, have also made a PDF eBook version available to purchase.
The eBook is
locked using the email address you provide when you purchase it (which is
supported by Evince) and you are able to print it, if you so desire. The PDF
does have bookmarks for the chapters, but does not have hyperlinked
crossreferences or other nice features. Unless you particularly like eBooks,
or can't get a hardcopy where you are, I'd spend the extra $8 for the real
thing.
On the whole, the book had both excellent and disappointing aspects. In
general, I like the order in which the topics were presented, though
occasionally the book gets bogged down in details that otherwise wouldn't
have a home and some important concepts, like Interfaces, end up introduced
midway
through a chapter where they are easily missed by the reader. I like the
summaries and exercises and the book is reasonably up to date, covering
GTK+ 2.10 and Glade 3.0. Unfortunately the book does not really cover major
parts of GTK+'s underlying infrastructure like Pango and Cairo as explicitly
as I think it should. Boiling it all down, this is not the book for someone
who knows GTK+ to improve their skills, but as its title suggets, will provide
the foundations for someone looking to learn GTK+, although not perhaps the
canonical GTK+ developer's style. I am giving it 3.5 feet out of 5.
Foundations of GTK+ Development: [IMAGE, 3.5 feet, 1.5 outline feet]
More information: http://gtkbook.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]