Container widgets

Recently I've been experimenting with container widgets. This page collects some of the results.

Most modern widget sets (GTK+, QT, Swing) support box containers as a way of laying out child widgets. Boxes are available with horizontal and vertical layouts. The children of the box are all forced to have the same height (for horizontal boxes) or width (for vertical boxes). The other dimension of the children can be configured to be fixed or to adjust in size as the parent is resized.

Although individual boxes aren't as flexible as a complex layout manager like the Motif form, in combination they can produce similar results.

I've implemented a box widget for Motif that's modelled on the GTK+ GtkBox, GtkVBox and GtkHBox widgets. It's based on Edward Falk's Gridbox widget from the X contrib directory and therefore has a very liberal open source licence.

Slightly more complex than GtkBox is GtkTable. This container allows the programmer to arrange child widgets in a rectangular array of cells. Child widgets may span more than one cell horizontally or vertically.

Again, I've implemented a table widget for Motif that has many of the features of GtkTable.

Going the other way, I've done some work on Steve Green's GtkForm widget. This is a GTK+ widget that has many features of the Motif form. Steve's original widget was written for GTK+ 1.x, so I've updated it to GTK+ 2.x. I've also added an attachment mode that's based on the Motif XmATTACH_SELF.

GtkForm is licensed under the GNU LGPL.


Ron Yorston
8th July 2005 (updated 27th November 2013)