Example code for drawing in a UIL application
This code creates a simple interface and draws colored squares from the system palette.
The UI structure is:

Follow these steps to use the UIL helper class:
- include the header file uilappcolor.h (from ~rth/public) in your .cc file.
- derive a class from UILApp (declared in the header file uilappcolor.h)
- in the constructor for the class, use the macro ADD_CALLBACK to register the callbacks with Motif. Each callback will be a member of this class.
- declare the callbacks in the class using DECLARE_CALLBACK
- define each callback outside the class using DEFINE_CALLBACK
- to use colors in the class, declare an enum with the color names exported from the UIL file, then use ADD_COLOR in the constructor. Colors then can be passed to color functions (such as XSetForeground) by using the color name to index the array UILColormap which is declared in the class UILApp.
The code for the UIL hierarchy is here.
The sample program that uses it is here.