Slashdot Mirror


Review: GTK+/Gnome Application Development

Thanks to our own Justin for the review of author Havoc Pennington (excellent name)'s GTK+/Gnome Application Development. Click below to learn more.

GTK+/Gnome Application Development author Havoc Pennington pages 492 publisher New Riders: ISBN 0-7357-0078-8 rating 6.5/10 reviewer Justin ISBN summary Learn how to develop a GNOME application from scratch using gnome-libs and various GNU development tools. Master the canvas, and expand your knowledge of GTK+/GDK/glib while you're at it. The book is released under an open license so that the book will have no problems keeping up to date with whatever is current in GNOME. It is browseable on the web at http://developer.gnome.org/doc/GGAD/ and can be checked out from GNOME CVS - it is in the GGAD module.

The book is not just a simple explanation of gnome-libs. Rather, it is a book meant to take you from beginning to end of a full GNOME application. GGAD starts off just where it should, with a ~50 page review of glib and GTK+. These sections were fairly well written, and I was able to understand them well. Keep in mind, however, that they are not for beginning glib/GTK+ hackers. The internals of how the libraries work are sometimes mentioned and I can imagine them being confusing to the first time GTK+ hacker. More advanced hackers can probably skip most of these sections, but even an intermediate GNOME hacker could gain a better understanding of how glib and GTK+ work.

The next sections discuss topics like what non-code files are required for a GNOME application (Makefiles, .desktop files, documentation, pixmaps, etc.) They are useful, and I thought occupied the right amount of space (not too little, not too much :)

Next comes a chapter I probably expected to come a bit later on. "Gnome Application Basics" is a summary of internationalization, popt, and configuration data. Unfortunately, I found the sections on configuration data a bit difficult to understand, and disliked seeing example code using some of C++'s more advanced features. Now we arrive at chapter 6, the chapter I think most GTK+ hackers looking to get into GNOME development will find most interesting. It is a discussion of the GnomeApp widget, GnomeUIInfo structs for menus, status bars, online help, tooltips, etc. Chapter 7 will probably also be useful to the same people. It is a quick (10 page) discussion of the GnomeDialog widget, and discusses several types of widgets. It well-written and very complete. Finally we have arrived at the last section of the book - "Advanced GTK+/Gnome Techniques". It is definitely for the more advanced hackers in the house. Chapters 10 and 11 are a very intensive (read: decently written chapter covering some slightly obscure topics in a lot of depth) overview of the GTK+ object system and a somewhat lengthy how to on the use of GDK (some parts I think may come in hand, some parts are probably pretty obscure). Chapter 11 is a titled "Writing a GtkWidget" and is well-written, but I question its usefulness to anyone but library developers. Unlike other sections, I felt this chapter had far too much actual code embedded within it (at least in the second half).

Next is a chapter I expect many people have been waiting their entire lives for ;) It is the long-awaited GnomeCanvas chapter. It is a ~25 page chapter which explains how to use the GnomeCanvas widget. The next chapter, Writing a GnomeCanvasItem makes a good counterpart, and the two work well together to teach the use of the canvas. It is a complex widget, so it may be hard to understand, however. I was lost at times, but I think this was probably me and not the book.

And that's most of it. The next 140 pages or so are all Appendices, some I found useful and interesting, others I found boring and skippable. However, I really must say that Appendix C, "Frequently Asked Questions", was very good and one of my favorite parts of the book :) The only remaining disappointments I had were the fact that the book was aimed towards very advanced developers (which was probably the major disappointment for me), and that libxml was not covered in at least small detail. I know that not everything can be covered, but XML is becoming central to many parts of GNOME.

Purchase this book at Amazon

  1. Overview
    1. Introduction
    2. glib: Portability and Utility
    3. GTK+ Basics
  2. Building a Gnome Application
    1. Creating Your Source Tree
    2. Gome Application Basics
    3. The Main Window: GnomeApp
    4. User Communication: Dialogs
    5. Gnome Applicatio Checklist
  3. Advanced GTK+/Gnome Techniques
    1. The GTK+ Object and Type System
    2. Gdk Basics
    3. Writing a GtkWidget
    4. GnomeCanvas
    5. Writing a GnomeCanvasItem
  4. Appendices
    1. GTK+/Gnome Object Hierarchy
    2. Table of Header Files
    3. Frequently Asked Questions
    4. Online Resources
    5. Code Listings
    6. Open Publication License Version 1.0

16 of 65 comments (clear)

  1. Re:Moderated down.. by Hemos · · Score: 2

    Other distros would be, if they made as much press. We only post what we can link to-and we only get work with the submissions. As it is, GTK is submitted 6 to 1 over Qt, Red Hat by as much as other distros.

    --
    Yeah, I'm that guy.
  2. Disagree about importance of widgets by Brett+Viren · · Score: 2
    Chapter 11 is a titled "Writing a GtkWidget" and is well-written, but I question its usefulness to anyone but library developers.

    I think encapsulating things into widgets is one of the primary strengths of any toolkit. Even if you are writing an app and not contributing to a library, writing widgets allows you to build a much more flexable program. I actually wish there was more, not less, focus on writing good widgets as well as subclassing and combining existing ones.

    That said, I agree with most of the review. Besides numerous typos (which are undoubtably fixed or to be fixed in the online version) this book is extreamely useful for anyone learning GTK and GNOME programming.

    Thanks Havoc!

  3. It covers automake!!!! by seth · · Score: 2

    So I bought this book a week ago and started thumbing through it and I see an actual printed chapter which takes about the automake / autoconf / configure junk which I've wanted to use for a very long time, but could never find a tutorial that was decent enough to not force me to thumb through man (or worse, info) pages. Yay!

  4. Re:GTK-- book?? by osu-neko · · Score: 2
    GTK+ seemed a bit contrived when I tried to learn it. They are using OOP concepts in C.

    What's wrong with that? OOP is very natural for expressing many problems, and is usable in _any_ language that supports the concept of a function pointer.

    Remember, OOP is a design methodology, not a language feature. Some languages add extra syntax to support it, but OOP is a matter of semantics, not syntax. Just because C lacks syntax specific to OOP doesn't mean it isn't capable of supporting OOP. It is.

    --

    --
    "Convictions are more dangerous enemies of truth than lies."
  5. Not bad ... in fact good ... but ... by LizardKing · · Score: 2

    ... I still feel that the GTK+ library an Gnome framework needs tyhe O'Reilly treatment. An exhaustive volume on each GTK+ widget and a similar tome on the Gnome GUI libraries.

    As for things like CORBA and XML as used in Gnome, these are probably worthy of a volume each themselves. As Havoc Pennington's book points out, the while Gnome environment is essentially various libraries that will make application development much easier.

    Note that I used the future tense. For those of us with little time to learn from the source of existing apps, good books are a must. Perhaps what we need is an entire Gnome series in the spirit of the O'Reilly X Programming books.

    Anyway, I'm now off to buy the printed copy of this book to show my appreciation that Havoc's publishers allowed him such an amazing license.


    Chris Wareham

  6. Learning automake, configure, et. al. by LizardKing · · Score: 2

    I spent a week of my holiday learning automake, etc. from the info pages. It was frustrating, but only because I started with the autoconf info pages, and then moved onto the automake stuff after a detour through the m4 pages ...

    Using the Gnome help browser was a major help - I'm not an emacs person, so the standard info reader was very unintuitive for me. For anyone contemplating learning the auto* thing, then I can recommend reading the automake page first. For smaller applications that don't rely on unusual libraries this makes the whole thing painless.

    For adding dependency checks (like looking for the GTK+ libraries), just cut and paste from existing Gnome and GTK+ apps. Only if your using some really of the wall librarues will you have to learn the m4 macro language.


    Chris Wareham

  7. Good companion volumes for this book by LizardKing · · Score: 2

    The two books I would recommend to accompany this book are:

    Advanced Programming in the Unix Environment
    by (the late and much lamented) W. Richard Stevens

    Unix Systems Programming for SVR4
    by David A. Curry

    The latter is a much underated O'Reilly book, that despite concentrating on one flavor of Unix is very useful for the Linux programmers out there.

    A really introductory book for Linux programming is `Beginning Linux Programming' by the usually iffy Wrox Press. It has a some naff stuff in it, but enough good bits to far outweigh the fluff like CGI and HTML tutorials that these sorts of book insist on having.


    Chris Wareham

    1. Re:Good companion volumes for this book by Natedog · · Score: 2

      Also, I really liked "Linux Application Development" - this is an excelent book that is very broad yet short and to the point (no stupid story lines about aliens or banks to fill pages). It talks about most of the development tools for Linux (compilers, debugers, libraries, etc) and it covers a lot of the system API. Good book.

      --
      \forall code \in C, \frac{\Delta readability(code)}{\Delta t} < 0
  8. Don't forget the GTK+ Tutorial by LizardKing · · Score: 2

    I learnt GTK+ from the tutorial packaged with GTK+ itself. While it's not exhaustive, it is pretty damned good.
    Chris Wareham

  9. Any other books from the Gnome team on the way? by LizardKing · · Score: 2

    Do any other members of the Gnome team at RHAD have books on the way? A complete book on ORBit would be fantastic, as the OMG C binding document seems impossible to find at their site.
    Chris Wareham

    1. Re:Any other books from the Gnome team on the way? by Havoc+Pennington · · Score: 2

      I don't know of an ORBit book in the works, though it would certainly be nice. Someone just contributed a nice CORBA tutorial which you can find on developer.gnome.org The GTK+ maintainers are writing a GTK+ book, which should be nice; and the GTK+ reference docs are moving along and will probably be published sooner or later

  10. Re:Moderated down.. by Ed+Avis · · Score: 2
    gtk shouldn't get any more covereage then qt, and redhat shouldn't get anymore then whatever else is out there..

    Yeah, and Mozilla shouldn't get any more coverage than Internet Explorer, and computers shouldn't get any more coverage than bicycles, and half the articles should be posted in French, and...

    Slashdot has always been about what Rob finds interesting. Fortunately, what he finds interesting is interesting to a lot of other people too - hence the huge popularity of Slashdot. This does mean that you have to promote some things above others.

    As for the particular complaints that you make, GTK is getting coverage right now because a book has just been released. That's why this story is under 'Book Reviews'. When the book Programming with Qt was released, there was a review of that too. And to many people, Red Hat's 100% free status makes it more 'interesting' than proprietary distributions like SuSE or Caldera.

    --
    -- Ed Avis ed@membled.com
  11. Not a "gentle introduction" by Booker · · Score: 3

    I got the book from FatBrain last week, and I've been plowing through it. I'm new to Linux development, and I don't have a whole lot of programming experience outside of Linux, either. This book is not an easy read. :-) If you're new to programming, skip it for now. If you're new to GTK/Gnome, I'd at least read the online GTK and Gnome tutorials first, and maybe have the GTK book by Eric Harlow(?), also from New Riders, on hand to cover GTK in a bit more depth.

    Don't get me wrong - it's a great book, chock full of good information. It's also the only book in print at this time which covers Gnome development, as far as I know. But if you're brand new to this whole business, it might be a tough read. I'm very glad to have it, though, because someday I'm gonna understand it all. :-)

    Kudos to Havoc and to New Riders!

  12. Note to Hemos by double_h · · Score: 2

    from the new-book's-to-read dept.

    That apostrophe just sets my teeth on edge. For those whose obviously slept through English class, here's how it works:

    • Contractions get an apostrophe where the apostrophe would go ("Here's an example")
    • Apostrophes are also used to indicate possession ("The book's cover art is impressive")
    • Apostrophes are not used to indicate plurals ("Hemos and CmdrTaco could both stand to read lots of books on grammar and usage")
  13. Re:Great, and Free by reptilian · · Score: 2

    Some people HATE online documentation. For things like programming especially, it's a lot easier to have a printed copy on hand when you're trying to learn something. Those people will buy the book. I don't have any money at the moment, so I'll probably start reading this online.. but once I get some money I'm definitely going to buy it.

    --

    72656B636148206C72655020726568746F6E41207473754A

  14. Information about the book by Havoc+Pennington · · Score: 5

    Please see http://developer.gnome.org/doc/GGAD for more information about the book.

    Keep in mind that one book can't be everything. This is a sort of "intermediate-to-advanced GTK+/Gnome programming manual". An introductory tutorial, complete reference, CORBA book, XML book, etc. would all fill pretty thick books on their own. I already wrote 492 pages instead of the planned 350. :-)

    But I think you'll find lots of useful information in my book, and of course you can check it out online at the above URL and decide for yourself.