Slashdot Mirror


Review:Developing Linux Applications with GTK+ and GDK

Eric Harlow, author of Developing Linux Applications with GTK+ and GDK has written a book well worth reading. A good first round of things, click below to find out how to write more of applications/widgets/whatever. Thanks to A.M. Kuchling for the review. Developing Linux Applications with GTK+ and GDK author Eric Harlow pages publisher New Riders rating 6 reviewer A.M. Kuchling ISBN summary A reasonably good first book on GTK+, though it's not likely to become the definitive one unless the second edition makes some minor improvements. REVIEW: Developing Linux Applications with GTK+ and GDK Eric Harlow New Riders

Nutshell
Review: A reasonably good first book on GTK+, though it's not likely to become the definitive one unless the second edition makes some minor improvements.
Rating: 6/10 A.M. Kuchling The Scenario-->

The GTK+ GUI toolkit was developed for the GIMP, and was subsequently adopted by both the current Mozilla codebase and the GNOME project. I believe this is the first formally published documentation for the GTK+ toolkit. (It is not a generic guide to application development under Linux, even though the spine of the book reads only "Developing Linux Applications".)

The book provides good coverage of the fundamentals that you need to know: the basic data structures provided by GLIB; the overviews of buttons, menus, dialog boxes, and all the other major widgets; and four sample applications -- a calculator, text editor, Minesweeper game, molecule viewer, and a simple Defender game. Harlow's development of each topic is understandable and helpful, making the book a vast improvement over struggling through the toolkit's source code, and well worth purchasing if you want to program with GTK+.

My one major problem with the book is, surprisingly, wishing there were more screenshots in it. The opposite is true of most computer books, because a screenshot and a paragraph of text can be made to fill a whole page, and helps immensely in padding out a book to make it look bulky and comprehensive. This book goes to the opposite extreme; there's no screenshot of the calculator application at all, and only one or two screenshots for each of the other sample programs.

Another flaw is that the book seems to contain every single line of code for the sample applications. As a general rule, in any given C program, 90% of the code is uninteresting; only 10% contains the heart of the program, and the rest is all scaffolding. I would have preferred to see a dissection of the central portions of each program in pseudocode and small chunks of C code, relying on the Web to get the complete distribution, instead of having to flip past page after monospaced page of program listings. So What's In It For Me?-->

This book rates 6 out of 10 points, because it covers GTK+ quite well, and provides you with the basic information you'll need to hack with it. It would get 7 out of 10 points if there were fewer pages of code and more illustrative screenshots.

Purchase this book over at Computer Literacy.

Table of Contents
  1. Introduction to GTK+
  2. GLIB
  3. Developing GUI Applications
  4. Basic Widgets
  5. Menus, Toolbars, and Tooltips
  6. More Widgets: Frames, Text, Dialog Boxes, File Selection Dialog Box, Progress Bar
  7. Writing a Calculator Application
  8. Developing a Simple Word Processor
  9. Minesweeper
  10. Graphics Drawing Kit
  11. Styles, Colors, Fonts, Cursors, and Referencing
  12. Molecule Viewer Using GDK
  13. Sprites and Animation
  14. Trees, Clists, and Tabs
  15. Creating Your Own Widgets

4 of 85 comments (clear)

  1. What about writing style? by Anonymous Coward · · Score: 2

    Am I the only one who thought Eric's writing style left a lot to be desired? The way this book is written, I had to read the code examples to figure out what the hell he was trying to say.

    There are also a bunch of simple stupid mistakes such as using one function name in a paragraph and using a slightly different one in the code example. It wasn't hard to figure it out but I shouldn't have to do that, it should be correct.

  2. OSS documentation quality by judd · · Score: 2

    I've noticed several criticisms of the existing GTK docs in the comments posted so far.

    I hope that all the people who posted them have communicated them to the authors. In particular, told the authors about:

    - typos
    - broken cross refs
    - unclear examples

    OSS documentation (which is notoriously poor) ought to be able to benefit from the same review-rewrite-release strategy as the code.

    So, don't just complain (fun though it is to let off steam). Send in corrections.

    I notice in the latest GTK tutorial there is an open invitation for contributions. I also notice more than a dozen named contributors.

    This is BTW the best way for people who are not ueber-hackers to contribute.

  3. Thanks for the comments by linuxnerd · · Score: 2
    I just want to thank everyone who has posted a comment about the book - even the negative comments. Hopefully, I can improve the book as later editions come out. Writing a book is a lot of work especially when you have a moving target like GTK+ to write about. GTK+ is *so* big that I couldn't possibly write about the entire toolkit. I just want to expose people to the capabilities of the toolkit.


    By the way, GTK+ is cross platform, but I don't have a Sun or other *nix to play with. I just work with Linux and want to see more Linux apps out there. I hope this gets some people started down that road.

  4. Another book idea by daviddennis · · Score: 2

    Granted, the book had some really annoying errors (as discussed in some of the other reviews), but I'd checked out GTK on the web, decided it was too difficult to bother figuring out, and did nothing.

    I checked out this book in the bookstore, and was off and running within an hour after having read the first few chapters. It's true that I ran into a bunch of snags because he didn't describe all the API calls, but it was good enough to get me excited and start me writing code.

    Incidentally, I really liked his examples, since many of them described things that I wanted to do with GTK, so they gave me a nice head start.

    I'm thinking it might be worth writing "Cross-Platform Database Programming using GTK+ and mySQL", using my new email handler/PIM application as a guide. Anyone think that would be interesting? There have been a lot of interesting pitfalls that I think would be worth documenting. And - an exciting thought indeed - it might be possible to do the development on Linux or even SGI Irix, and then send the result straight to Windows, Linux, Irix and SunOS without having to (ugh!) develop on a Windows system. If that would work, I'm pumped.

    D

    ----