Rapid UI prototyping with Glade
January 30th, 2007I’m no artist and when it comes to design it usually takes me several attempts to get it right. This is where rapid prototyping comes in handy. Being able to quickly and easily produce a design, twist, turn and tweak it or simply throw it away and start again is a vital process to any application design.
Step up Glade
Glade is probably one of the most underrated development tools for Gnome. It makes prototyping an interface a sinch, with no need to worry about typing out laborious GTK+ code; move everything around, add and remove features from your design and mess around with settings quickly and easily until you have something you’re happy with.
Once you have your final UI design, you have two options. Either use libglade to set up your application UI or convert the glade UI in to real GTK+ code by hand.
The former is far simpler, but the latter adds more flexability, removes redundant widgets and a dependancy on libglade and increases performance.
Converting the Glade XML by hand isn’t as much of a chore as it sounds. Widgets in the Glade XML only define options that have non-default values so you simply need to arm yourself with the GTK+ documentation, run down the XML and implement each widget, adding children where necessary.
Guest starring: Anjuta
While Glade is great for prototyping a UI, testing your UI (Glade appears to render slightly differently to GTK+, so it’s a good idea to run the prototype properly), converting it to GTK+ code and of course, writing the actual program code is a necessity. While gedit, vim and emacs are all fine for the job, creating a source tree and build system for your application can be a bit of a nightmare.
There’s nothing worse than spending more time debugging your build scripts than your program code.
Anjuta makes it all easy – while it may not generate the most optimal build scripts – it does a good job of providing you with a source tree that will build without the need for any tweaking. Which is perfect for testing your UI prototype quickly and without fuss.
I’m just starting out with GTK+ programming and, in fact, C; but I’m already finding tools that make the learning curve so much less steep.