Wednesday, January 22, 2014

Programming the Roma Widget Set (C# X11) - a zero dependency GUI application framework

Inline image 1

This article deals with the practical use of the Roma Widget Set (Xrw), a C# GUI application framework, that is directly based on X11 library calls. The idea of the Roma widget set has been developed from the first article of this series, Programming Xlib with Mono Develop - Part 1: Low-level (proof of concept). This article provides a sample application's complete project for 32 bit and 64 bit.

First - the main disadvantages:

The complete framework is crafted - there is no big developer comunity in the background.
The framework uses the capabilities of C# and X11 (via P/Invoke) only - currently no additional libraries like Xt, Xpm, Xft, Cairo, Pango, ...  are involved - i.e. drawing capabilities are limited (no gradient color, no antialiasing). 
It is platform dependend - it runs on X11 only.
There is no GUI designer.
Currently only 24 bit and 32 bit color models (16 777 216 colors) are supported.

Second - the main advantages:

The framework is small, very well inline-documented and can be adopted/extended to a specific need easyly.
The framework comes with complete source code and is wirtten entirely in C# - all parts of the framework can be maintained from a single C# solution or project.
The framework has no dependencies except X11 and it has zero overhead. It is very lightweight and fast.
It might be, any future version includes the option to use additional libraries or run on other platforms than X11. 

This provokes the question - why another GUI application framework?  The answer is the fun to deal with it, the individuality that applications can reach and the flexibility to design an uncommon GUI for a specific application.

The Roma widget set has been designed to support programming of simple GUIs for small tools. It's focus is the efficiency in application, not the completeness of rerely used features. What are the alternatives?

All other widget sets - the Athena widget set and its descendants (e. g. neXtaw, XawM, Xaw-Xpm, XawPlus or Xaw3d), the Motif widget set (Open Motif or LessTif), GTK (GTK+ alreaty has the C# wrapper GTK#) and KDE (Qt already has the C# wrapper Qyoto) - are developed in C/C++ and are very hard to adopt/extend to a specific purpose within a C# project.

Read more: Codeproject