McCLIM's tab layout

Paolo Amoroso used to blog about McCLIM commits. But he stopped posting updates some months ago, so here is my own report, starting with the tab-layout.

The original tab-layout, written by Max-Gerd Retzlaff, implements a CLIM pane similar to what GTK+ calls GtkNotebook, using only portable CLIM mechanisms to do so:

With my changes, committed a few weeks ago, the tab-layout's architecture is now closer to other gadgets in CLIM, which are split into an abstract superclass and several frame-manager-specific subclasses. This new version allows the Gtkairo backend to implement its own subclass using a native GtkNotebook:

One aspect of the tab-layout that still stands out is the use of presentations and commands. While both are fundamental CLIM concepts, other gadgets defined in CLIM 2 come without any integration into the presentation system, so there was some discussion about turning the tab-layout into a "proper" gadget using simple callbacks instead of commands.

In the end, I decided to keep the use of presentations in the generic tab layout and hack its Gtkairo version to simulate them, too. To me, the greatest advantage of this implementation is that, thanks to presentations, there is an easy way to define context menus for tab pages in a CLIMy way.

You can try the new-and-improved tab-layout using simple demo code included with clim-examples (start it using (clim-demo::demodemo)), or by trying one of currently two real applications featuring tabs. One of them is beirc, the other is the web browser closure, which now supports tabbed browsing!