Go to the first, previous, next, last section, table of contents.
We have in this tutorial presented an overview of the features and
capabilities of Haggis, a graphical user interface in and for the lazy
functional language Haskell. By way of a series of examples, the
features and ideas underlying Haggis were presented:
A user interface component is viewed as a virtual I/O device
-
The model for creating and accessing user interface components is
similar to the way devices such as files are interacted with in Haskell 1.3.
Graphics is described declaratively
-
All graphical output in Haggis is described using Picture
values. Pictures can be transformed, combined, printed, saved etc.
User interface components are represented uniformly
-
User interface components are represented uniformly using the
DisplayHandle type. A DisplayHandle is a reference or handle to
a component, and is used to issue window system commands and requests
along.
Interactive behaviour is added by encapsulating components
-
To catch input or make a user interface component come alive, Haggis
uses encapsulation to catch and interpret user input events performed on
the component. Haggis provides a basic combinator catchDeviceEv,
which encapsulates an existing component by rerouteing all the events
representing user actions to separate handle.
Layout described using functional layout combinators
-
The layout of a user interface is described by combinators of the form
hbox :: [DisplayHandle] -> DisplayHandle
taking a list of DisplayHandle and returning a new value
representing the set of components laid out.
Communication between user interface and the underlying
-
application is done via abstract interactive device handles
Although there is no rigid separation between application and user
interface in Haggis, the application tends to be added piecemeal to the
user interface, building more and more application semantics to the
constructed components.
Style environments used to customise component instances
-
To deal with the problem of configuring a component's look (font to use,
colours to use etc.), functions that create user interface components are
passed an environment containing a Style environment. The Style
contains a mapping between customisation options and values to use.
If the tutorial has left you with an unfilled stomach, help yourself to
some more Haggis by looking at the Examples section, See section Some examples of Haggis programs/A haggis primer.
Go to the first, previous, next, last section, table of contents.