Review: GTK+/Gnome Application Development 65
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 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
- Overview
- Introduction
- glib: Portability and Utility
- GTK+ Basics
- Building a Gnome Application
- Creating Your Source Tree
- Gome Application Basics
- The Main Window: GnomeApp
- User Communication: Dialogs
- Gnome Applicatio Checklist
- Advanced GTK+/Gnome Techniques
- The GTK+ Object and Type System
- Gdk Basics
- Writing a GtkWidget
- GnomeCanvas
- Writing a GnomeCanvasItem
- Appendices
- GTK+/Gnome Object Hierarchy
- Table of Header Files
- Frequently Asked Questions
- Online Resources
- Code Listings
- Open Publication License Version 1.0
Re:Not a "gentle introduction" (Score:1)
Little 'info' tip.. (Score:1)
Re:Moderated down.. (Score:2)
Re:Learning automake, configure, et. al. (Score:1)
Anyway, these have a wizard which sets up your project - autoconf, automake etc, as well as
I thinks its best to relegate make files to being out of sight, out of mind, since their not the most friendly of things to look upon.
You might want to check out the LDP's Linux Programmers Guide as well.
Disagree about importance of widgets (Score:2)
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!
Re:Disagree about importance of widgets (Score:1)
Case in point:
When I started coding my first Gnome application (a port of an editor/viewer for certain game records), I quickly became annoyed by the fact that I had to deal with implementing things like popping up Open, Save and Save As dialogs, as well as prompting for confirmations when exiting without saving, etc.
Porting as I was from a Doc/View based MFC app, I didn't have existing code to throw at this, even though I did have all the routines to do the actually saving and loading. So I just buckled down and wrote my own widget to take care of this stuff -- give it routines that, given a filename, will save or load, and it will deal with all of the user prompting.
Having done that, my code is much more modular and easy to maintain, and as an added bonus I have a completely general, reuseable widget. Any time I need to make a single-doc-interface program, I can just pull it out -- and I know it's bug-free, because I've used it so many times before. (As a proof-of-concept when designing the widget, I used it to write a notepad-like editor. Took all of 10 minutes or so.)
Sure you can always cut and paste code from project to project, but if you really want to reuse code, writing your own widgets is the way to go.
JRaven
It covers automake!!!! (Score:2)
Comparison to Other Books? (Score:1)
--Phil (Not that the money stays long in any case...)
Re:Disagree about importance of widgets (Score:1)
Have an object orientated toolkit is vitally important nowadays. It helps keep code size down whilst still allowing all the fancy doodads that people expect.
I think people need to get into the habit or writing object orientated designs with GTK+ to maximise the benefits of the toolkit rather than getting stuck in the bad C habit of making every thing a global variable !!! (This mainly relates to people new to coding, but i have seen some *terrible* designs !!!)
Lets face it, in general C is a damn site easier to get that hang of, and get started with, compared to C++ !!! which is why a lot of people will probably start writing programs in GTK rather than QT (By the way, i think the QT toolkit is a very nice piece of design, i just don't like the license...
Iggy
Re:GTK-- book?? (Score:1)
Will you C++ users give it a rest? I swear you people are becoming just as anoying as the Java/ Amiga Arexx users....
pinfo!! (Score:1)
(as a side note, pinfo can also do manpages very nicely, including turning references into 'links')
Daniel
Interface resources? (Score:1)
Does GTK+/GNOME support interface resources like MacOS, Windows, OPENSTEP/GNUstep, etc. do? In other words, can I define most of my interface without writing code that says "place a button here, place another button here, create a toolbar, put this button and this button in the toolbar..."
Re:ahh, who cares.. slashdot is beyond biased (Score:1)
Re:GTK-- book?? (Score:1)
The only thing thing C++ gets you with regards to OOP that doesn't find easy expression in C is multiple inheritence. This can be accomplished in C as well, but it's ugly. If you need it, go with C++. If you don't, C is perfectly adequate for OOP.
--
Re:GTK-- book?? (Score:2)
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.
--
Loved the Book (Score:1)
Disappointing aspects (Score:1)
I don't know if it's because I'm on a weird part of the learning curve or because of deficiencies in the book, but there were a lot of things that I was dying to know about that weren't covered in the book. It would have been nice to have had information organized by conceptual topic in the index as well as by code. E.g. how to create right click popup menus is the conceptual topic, but using gnome_widget_popup_foo is the code topic.
Also, what I really wanted that the book didn't have was entries in the index for ALL functions that were discussed (or mentioned) in the book, not just the ones that had minisections about them. That way, even if the function was only mentioned, you can still get a feel for what it relates to by checking out the information that surrounds where it was mentioned, if you know what I mean.
The book as far as an intro to Gnome though was very good. I enjoyed reading it, and I'm damn sure glad that it exists. A book of this type doesn't have to cover everything, (as HP pointed out that it can't) but it does a fairly good job at what it *should* do, which is to allow the reader to get a toe-hold into gnome, to the point where reading the reference documentation will actually be helpful. I found that the book was a success in that respect.
Not bad ... in fact good ... but ... (Score:2)
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
Learning automake, configure, et. al. (Score:2)
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
Good companion volumes for this book (Score:2)
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
Don't forget the GTK+ Tutorial (Score:2)
Chris Wareham
Any other books from the Gnome team on the way? (Score:2)
Chris Wareham
Re:Moderated down.. (Score:2)
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 [slashdot.org] of that too. And to many people, Red Hat's 100% free status makes it more 'interesting' than proprietary distributions like SuSE or Caldera.
Re:Comparison to Other Books? (Score:1)
Not a "gentle introduction" (Score:3)
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!
Re:ahh, who cares.. slashdot is beyond biased (Score:1)
Re:Learning automake, configure, et. al. (Score:1)
Re:Good companion volumes for this book (Score:1)
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."
Agreed. It is one of my favorites. I would recommend it to anyone developing in Linux.
Re:Note to Hemos (Score:1)
Re:Good companion volumes for this book (Score:2)
No CORBA! (Score:1)
I ordered the book before it came out from Amazon and it's treated me well so far. The book bites off a lot and so the pace is *very* quick. You won't read a bit and be Miguel overnight. It is not the end-all GTK+/GNOME book, but a great introduction for people willing to learn. In just the 2nd Chapter, I've pulled out several advanced/expert C programming books to follow along with the code (and you think C++ can be difficult at times!). I've said it before on
So in closing, if you know how to program and are thinking about buying some docs to get going with GNOME and GTK+, you need this book, a GTK reference, and 'Deep C Secrets' wouldn't hurt either.
Good luck.
Re:Not bad ... in fact good ... but ... (Score:1)
GTkGLArea? (Score:1)
Thats at . . . (Score:1)
GTK-- book?? (Score:1)
To be honest, I found that the primary barrier to learning GTK+ was a lack of a good source of documentation. Maybe this book will change all that. I guess I'll have to pick it up and see.
<SIG>
I think I lost my work ethic while surfing the web. If you find it, please email it to crispy@crotch.caltech.edu.
</SIG>
Re:Moderated down.. (Score:1)
Every story should be given a ranking (1-10 or something) that is a measure of how important the current story is w.r.t. that category. ie. Redhat announcing it's IPO or a new release would be 10's but Redhat IPO updates would be 5's or something. Then a user could set a threshold for each category (0 shows no posts, 10 only the most important, 1 shows all posts)
Of course this would be a purely subjective determination by the poster. If we wanted to get really hardcore into it then the importance could change due to moderator input/number of posts/number of positive moderator points given/etc.
I know Rob has his hands full with updating the site all the time but this system sounds like a great Idea to me. What do the rest of you think?
<SIG>
I think I lost my work ethic while surfing the web. If you find it, please email it to crispy@crotch.caltech.edu.
</SIG>
Re:GTK-- book?? (Score:1)
<SIG>
I think I lost my work ethic while surfing the web. If you find it, please email it to crispy@crotch.caltech.edu.
</SIG>
Re:Just when I thought I'd had a good idea (Score:1)
<SIG>
I think I lost my work ethic while surfing the web. If you find it, please email it to crispy@crotch.caltech.edu.
</SIG>
Father forgive him (Score:1)
You are obviously ignorant on this matter.
When it comes to OOP Java is better than C++, and C++ is better than C. Not my opinion. Just plain fact.
<SIG>
I think I lost my work ethic while surfing the web. If you find it, please email it to crispy@crotch.caltech.edu.
</SIG>
Note to Hemos (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:
So why is a beta redhat in here.. (Score:1)
Re:Moderated down.. (Score:1)
i've loved slashdot, and loved its articles. But it truely seems biased.. as news for nerds and stuff that matters should be news.. not what joe schmoe runs, it shouldn't be any better or worse because 1 out of 10 use it or 6 out of 10 use it.
the site is nice, maybe there should be a minor news section, maybe linux stuff should be rolled off from being headlines to its own group.. the bsd and be and other people have complained about this..
personally GTK is good, i'm happy to see a book. but its not revolutionary, and its not any more news then redhat coming out with a beta, more so, i would have considered putting news up about Open Linux 2.3 with its huge jump in useability and functionality.. news about how the G4 works, not about how its marketed.. its news for geeks, not news for marketing peoples who play golf all the time :)
hehe, i apologize for the off topic, and the continuation of going for a point that really has no point (since there really is no argument, this isn't my site to controll).
But, i'd like to see a broader scope of whats considered news for nerds, and not news for gnome or news for redhat or news for linux, but whats technology doing for me.. that covers bds, linux, solairs, java, c, c++, perl, python, disks, ibm, microsoft, everything really..
Re:Note to Hemos (Score:1)
Exception - possessive of 'it' does not get an apostrophe ("My widget broke its wizzo")
Viewing man and info (Score:1)
Re:Great, and Free (Score:2)
Re:So why is a beta redhat in here.. (Score:1)
I agree with Finkployd when he says "if you don't like the articles, DON'T READ THEM!". Hell, I've skimmed over lots of articles
Re:GTK-- book?? (Score:1)
I am trying to use GTK-- with great difficulty.
The "stable" version does not have enough examples. The CVS version has lots of examples but I can't get them to build.
Perhaps I will have to wait until I have time to build every thing from source (GTK+, gnome-everything, gtk--, glade,
I would highly recommend glade for using GNOME/GTK+ with C.
I don't think GNOME will ever support C++ very
well. Linux people seem to think C++ is a bad thing.
Re:Interface resources? (Score:1)
It stores the resources in XML. It also generates all the component
initialization code and empty event handler functions for you.
Re:Comparison to Other Books? (Score:1)
Great, and Free (Score:1)
Re:Book not technical enough. Little value-added. (Score:1)
What are you smoking?
It's 492 pages long with a small font, I wrote all the example programs, and it was not the first GTK+ book - Eric Harlow's was.
Re:Any other books from the Gnome team on the way? (Score:2)
Information about the book (Score:5)
Please see http://developer.gnome.org/doc/GGAD [gnome.org] 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.
Re:Book not technical enough. Little value-added. (Score:1)