Graphical User Interfaces in S

We have developed an S chapter which interfaces to several components of the X window system, This allows users to create graphical interfaces and respond to events, etc with relatively simple programming techniques. Most of the functionality of Xlib and the XtIntrinsics are available and numerous widget sets have been made available. A simple mechanism exists to allow new widget sets to be introduced. This allows specialized widgets (e.g. plotting, table layouts, etc.) to be easily integrated into an application.

This chapter provides a simple mechansim for creating GUIs. This allows rapid prototyping even if the final product will not be implemented using these tools. We introduce a class for representing widget hierarchies that make up a GUI or a sub-part of it. These are persistent S objects and can be merged with parallel objects which specify event handlers, resources, etc. This allows for different characteristics of a GUI to be easily changed without recompilation of any code, etc. Similarly, libraries of these widget hierarchies can be created and reused, promoting quick development and more importantly interface consistency.

Since S is interpreted, interactive querying of widget types can yield useful information about resource types, available converters, etc. Additionally, the resources of a live widget can be queried and set by a user or an application developer. All the standard X resource specifications are also available.

The current status of this project is unclear. It works relatively comprehensively but has not been optimized and requires a validation method for non-persistent external objects to reduce the burden on the user. The current version works in the vanilla version 4 of S. It has been the intention from the onset of this project that each GUI within the S process would run it is own thread using the threaded S4 implementation. This requires marginal changes to the chapter source but more significantly requires recompilation of the X libraries and thread-safe use of libraries such as Motif.

Examples of some code that generate and manipulate GUIs are provided here as a rough indication of what the toolkit will offer.


Duncan Temple Lang<duncan@research.bell-labs.com>
Last modified: Wed Nov 26 10:09:50 EST 1997