[prev] [up]

Graphical user interface (GUI) classes

The GUI classes are packaged into multiple libraries of which some can be left out even for a fully working system with graphical user interface.
For example, all classes related to program development have been packaged into separate libraries (libtool, libtool2); required widgets have been separated from less frequently used ones etc.
This was done to make packaging of end user applications easier.

For special needs, enduser applications can even be built by specifying each individual class thats to be included. Of course, on systems which support dynamic shared libraries, there is no need (and no advantage) in doing so.

Since no smalltalk standard exists for the GUI classes, each smalltalk vendor's GUI interface differs more or less (there are also legal reasons for this). Thus, porting graphical applications involves some effort and recoding (however, in separating the presentation from the functionality of application objects, this effort can be reduced considerably).

The following gives you a rough idea of existing widgets. For more detailed information, please read the introduction to view programming which gives you a step by step intro and is very valuable for a quick entry.

Detailed information on individual classes is found in the class documentation.

The Smalltalk/X low level GUI support classes support (among others):

The higher level views (so called widgets) are built using the above basic objects or derived from the generic view classes. Among others there are: These components are typically glued together by valueHolders - these are object, which hold a reference to some object (the so-called model of a widget) and notify others whenever the model changes. Typical models values are: Booleans (buttons, toggles etc.), Strings (inputFields, editText widgets, Lists (selection-in-list widgets, fileSelection widgets) or hierarchical trees (treeview, fileTreeView etc.).
All of those valueHolders are normally created and maintained by an application; in ST/X (and other smalltalks), this is typically an instance of ApplicationModel. This class provides a generic and powerful framework for GUI applications, in that it provides support for view building (from a so-called windowSpecification), widget interaction and closeDown.

Although it is possible to create an applications GUI manually (by creating widgets and glueing them together), this work is usually done by creating a windowSpec with the GUI painter tool. This lets you compose an application by dragging components into a canvas and defining the valueHolder names (so called aspects).

Built on top of these are building blocks for complex user interactions:

and finally the Smalltalk programming tools themself:

All user interface widget classes and tools are implemented completely in smalltalk. All of the smalltalk source code is included in the distribution.

Notice that these can be used either as building blocks to create complex views consisting of many elements, or (by subclassing) as a starting point to create modified versions; either for changed behavior or changed presentation.

The Smalltalk/X view classes support both the traditional Model-View-Controller (MVC) programming paradigma and an action driven scheme. The later being perfect for simple interaction, in that no MVC relations have to be setup for actions like 'doing something on a buttonpress'.

The look of the view classes is configurable via stylesheet files.


Copyright 1995 Claus Gittinger Development & Consulting

<cg at exept.de>

Doc $Revision: 1.18 $ $Date: 2021/03/13 18:24:50 $