Changing the Look and Feel - WidgetKit Revisited

WidgetKit provides a convenient way of creating standard interface objects like buttons, menus, etc. Usually this is the most convenient way to create them. If you want to customize such objects, you can instantiate them directly, without using WidgetKit. For example, while you could get a button by using the method:

   WidgetKit::push_button(Glyph*, Action*);
you could also instantiate a button more directly, using:
   Button::Button(Glyph*, Style*, TelltaleState*, Action*);

The Style and TelltaleState control the appearance and behavior (or look and feel) of the button. Styles contain attributes for such things as fonts and colors, while a telltale handles several different appearances for an object (such as pushed or not pushed). The WidgetKit operation for creating a button uses a particular style and telltale. Typically, all operations for a WidgetKit will have a comparable look and feel.

More interestingly, this suggests that by simply changing the WidgetKit to instantiate objects with a different style, you could use the same code in your program to create an entirely different look and feel. In fact, InterViews does this to support several different styles. The Session object interprets command line arguments (or X defaults), and can also control exactly what WidgetKit is used when you call WidgetKit::instance(). The table shows the possible styles.


Option X Default Description Notes
-motif *gui:Motif Motif style  
-smotif *gui:SGIMotif very nice customization of Motif current default
-openlook *gui:OpenLook Open Look style not implemented yet
-monochrome *gui:monochrome monochrome version of Motif not in 3.1α