Introducing gtk+ 2.0 Change Theme

Saturday, 24 Jan 2004

I had been been unsatisfied with various aspects of Gtk Theme Switch for a long time. Yesterday I finally broke down and had a go at it. It was a welcome opportunity to brush some rust off my C skills and also get more intimate with gtk+. In the process I discovered that with the aid of GLib, writing straight C is a lot less tedious than what I remembered. I can see myself getting away a bit from Perl. Not that I’ll ever fall out of love (actually, hopeless infatuation) with the Camel, but I really need to broaden my horizon.

Anyway, the process went something like this:

  1. Remove the tarball installation features, because I’ve never needed that stuff and feel it should be done by way of package management anyway.
  2. Add code to filter away theme directories that do not contain a gtk+ theme – this greatly reduces the clutter in the theme list.
  3. Present the theme names in a scrollable list rather than a combobox, so that it’s much easier to browse and doesn’t require a multide of clicks from mouse potatoes every time they want to select a different theme.
  4. Get the dialog window to update itself as a preview rather than launching an extra process to open a separate preview window. This does away with a bunch of nastiness in the code.
  5. Preview immediately when a selection is made rather than requiring a click on on Preview button.
  6. It then becomes more sensible to have Ok & Cancel buttons rather than Apply & Quit. At this point there are sensible choices among the stock icons, which makes the window a whole lot prettier too.
  7. Finally, I integrated the demo widgets from the preview window into the main dialog, added a bunch more, and amended the About page.

It was pretty fun to go through all that, building one step upon the previous. The end result is so different from the original program that I decided to opt for a new name: gtk+ 2.0 Change Theme 0.1. I dare claim that it is lightyears ahead in terms of ease of use. Enjoy.