GTK+ Is A Very Good SDK

GTK+ is a user interface toolkit for Linux.  It serves a similar purpose to WIN32, Windows Forms, WPF, Qt, Carbon, and Cocoa.

Until recently I had only used GTK+ indirectly, through wxWidgets, which is a wrapper around the UI toolkits for Windows, Linux, MacOS, and others.  Ordinarily I’d just stick to wxWidgets so I don’t have to write similar code multiple times, but I’m working on a project with a significant download size restraint and have to keep it minimal.  The overhead wxWidgets adds is a no-no.

I have a copy of Foundations of GTK+ Development by Andrew Krause and picked up the basics through that.  As in introduction it’s a good place to start, but the book itself is all over the map and examples tend to be somewhat incomplete.  It’s obviously written by someone new to writing tech books.  I’m still glad it exists — saved quite a bit of time getting started.

GTK+ uses container-based GUI sizing and layout and relies pretty heavily on macros, but you don’t have to deal with populating tons of cobbled-together custom structs and incomprehensible parameter lists (WIN32) or deal with an ass-backward programming language like Objective-C (Cocoa).  Binding event callbacks is straightforward and you don’t need to create an event map or do any strange run loop management.

It’s quite sensible and has a well-thought-out API.  Any time you want a function to exist or want to have a control type available it’s probably there.  I was able to build four working dialogs in a day’s work and at no point was there a head-scratch “How the heck does this work?” moment.  The docs are also pretty thorough and easy to read on the site.

Well done, GTK+ team.

1 Comment

  • gukk says:

    please finish basternae 3 I know a lot of people will rejoice, we are anticipating and are willing to leave duris 🙂