Glade 3 sees the light of day

The GUI designer tool that has been building your GTK+ applications for years is back with a completely new generation of homegrown free software. Supporting all the widgets in the GTK+ 2.8 family, gnomeui widgets, the gnome canvas widget, and a whole new feature set, this new tool is sure to raise a few eyebrows.

Glade 3 has been a lingering myth for several years now. Originally thought up and designed by Chema Celorio, Damon Chaplin (author of the original Glade tool) and others who were around back in 2001 before GTK+ 2.0 was ever released; Glade was worked on vigorously by Chema, Carlos Perello Marin and others. Chema was an outstanding contributor to GNOME in many ways and was unfortunately taken from us in a skydiving accident in november 2003, this one goes out to you Chema!

Joaquin Cuenca Abela, who was working on edalg, picked up work on the Glade rewrite later in 2002 and hacked hard, along side Paolo Borelli and many others for a good few years. In the mean time when GTK+ 2.0 had finally hit the streets and it was apparent that the rewrite was going to be a little bit late; Glade was ported to the new GTK+ without a redesign: “after all” says Paolo “it was supposed to be a stop gap solution for a few months” – Damon has since then been bearing with us and keeping the port up to date with the new GTK+ widgets that we all need.

When I stumbled upon Glade 3 (for some work related reason); Joaquin was nowhere to be found and the mailing lists had been down for a few months, so I sent mail to lists, kicked and screamed and then in september 2004 we got the project back on its feet again.

David Hoover took maintainership duties and put gtk-doc headers on all the functions everywhere, we all thought it was a little much; but now we have great documentation so thanks David! I’d have to say we had our own rocky start since we all agreed that Glade should be using libglade as the parser module of Glade proper, this was an expensive change in design to finally ditch (it all turned out to be to complex and had namespace issues to boot).

Since then Glade has been simmering and refining itself under my watch, it’s been lonely at times but I’ve usually had the company of at least one other solid contributor; Juan Pablo Ugarte and Ivan Wong to name a couple.

Thanks to all the great people that brought Glade to be over the long years, patch writers, translators, maintainers, those people on IRC that said stuff like: “why does Glade crash when I add a text entry?”, and bug reporters alike; we’ve been able to realize this great project that has been for so long, only a hope and a dream.

So what’s so good about the new Glade tool?

Glade will not do your dishes or walk your dog, but here are a few of the things that it does do now:

  • As a base standard, you are now allowed to undo and redo all of your actions that effect your project widgets with a history list of the entire session, so no more fear about making crazy mistakes; deleted widgets come back to life.
  • You can now manage multiple projects at once and move widgets back and forth freely, sporting a recent project list for your added convenience.
  • No pain switching tools: this new Glade tool supports all 2.8 widgets and is fully compatible with the libglade format and reads Glade files generated by Glade 2 like a champ.
  • You can now integrate your own widget catalog into the Glade tool as well as libglade. With the available documentation ; adding a widget to your custom widget catalog should normally be a matter of a few lines of XML.
  • Next on the menu, for your added user wowing blingness, we’ve got your new palette that resizes impressively:

  • Drag and resize support now available in GtkFixedGtkLayoutGtkTable and GtkBox classes.

  • Contextual help using the Devhelp documentation browser.

  • As usual, Glade also builds wherever GTK+ builds.

Under the hood

For the curious, heres a little look at what makes it tick. The new Glade tool takes maximum advantage of introspection mechanisms in the GObject framework in order to minimize the work load of widget integration and allow for a more generic way of supporting widgets, properties and signals in general.

This Glade was also designed to be a simplified component, now there is no code generation and it can be embedded into an IDE:

An IDE would also be the right place to install code generation plugins if that were really desired.

Glade is now also sporting a dynamic widget catalog, which gives you fine-grained control on how your new widget can be handled by the Glade tool, basically; Glade will lookup the type, initialize the object class and introspect all the signals and properties. After that, the internal representation of widget classes are updated from the catalog. Support routines can be loaded from the plugin backend and properties’ defaults can be overridden, properties can also be added to widget classes. Glade will load these catalogs at startup in order of their dependencies so that each catalog that is loaded inherits the functionality of its parent, for example – a custom derived GtkBox will come with fully functional drag support for its children. We’ve implemented the libgnomeui and gnome-canvas widgets as separate catalogs and they will be distributed separately.

A container abstraction layer is present in Glade 3 that allows you to treat certain hierarchic relationships specially; in this way, any object can parent any other object, furthermore, many container relationships can be defined for a single object class; each performing container tasks (add/remove/child properties) via separate code paths. Because of this abstraction, a treeview like object could also be a normal container and allow for widgets to be added in the normal way, but also support the addition of child treeview columns and those treeview columns’ child renderers, etc. We hope to be able to address all the possible object hierarchies that can exist using this technique. This type of functionality actually already works (TouchTunes has been using Glade 3 with GObject delegates for about a year) if you apply the gobject support patch to libglade. Currently using non-standard hierarchic relationships in libglade require you to write custom code to build and add the children to their parents; hopefully with the GTK+ builder we’ll be able to address that problem in the widget code itself.

The Future

For those who didn’t know, GTK+ will be supporting Glade files natively as a part of the 2.12 release cycle (or a very similar format). The GTK+ builder will support building gobjects and also allow for tricky hierarchic relationships in an encapsulated fashion. It’s a big priority for Glade to support the new format as it will unlock a lot of doors to new features. What this spells is that users will finally have access to treeview columns, treemodels, sizegroups, adjustments, actions, pixbufs and all gobjects. We plan to maintain compatability with both Glade formats and allow for smooth conversions between the two formats.

We also have a new contributor worth mentioning, Jeff Westerinen, a developer from PalmSource Tools Development says:

PalmSource has always provided our licensees and developers with the tools it takes to create great applications, so when we decided to transition our platform from a proprietary offering to one based on open source components, we were faced with the task of searching for tools in the open source community that would suit the needs of our developers. One of those tools was a UI editor. Having made the decision to adopt GTK+ as our UI platform, we went in search of a GTK+ UI design tool.

After some research and mailing list interactions, Jeff stumbled upon the new Glade:

In short order, I’d downloaded the module, read the documentation, and, with great help from Tristan, Juan, and others, our widget designer and I were able to add our own widgets within about a week.

Recently, Jeff has been given the “go-ahead to begin to contribute to the Glade 3 project” and goes on to say:

I can honestly say that, from the start, this has been a very positive experience for me, and I’m looking forward to being a part of the Glade 3 team.

Welcome Jeff, together let’s make GTK+ look awesome on the handheld!

Vincent Geddes (author of that sexy palette) is also working on the most exciting and visual new Glade features (as usual). The first revisions of the single window version of the Glade UI that embeds the project widgets will be available in CVS HEAD shortly.

And of course there are many features on the wishlist! I’m still wondering who will be the lucky contendor to implement the “style” tab in the property editor… (hint)

About the author

Tristan Van Berkom lives in Montreal (Canada) and is currently working for TouchTunes Digital Jukebox, a basement and coffee brewed, self-taught hacker who discovered the computer back in 1999. His passion and life discipline is b-boying (breakdance) and his hobbies include writing jukeboxes, writing Glade and enjoying the view at the swimming pool. Luckily the jukebox gigg has been paying the bills for quite some years.

Discuss this story with other readers on the GNOME forums.


Posted on August 15, 2006, in August 2009. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: