3 The guienv Library

Guienv is the most basic library of the Lidskjalv libraries. Guienv implements the most often used elements of a graphical user interface, such as menus, windows, etc. along with a lot of supporting facilities.

The prime elements of guienv is the definition of the menu system and the facilities for defining windows along with facilities for handling the events (such as mouse button press), originating from the user interface (menus, windows, etc.).

The most important classes, defined in guienv are:

The rest of the attributes defines various other facilities for accessing different other aspects of the window system.

The most important class in Lidskjalv is interfaceObject. It defines the facilities available for controlling all interface components in guienv.

interfaceObject implements the basic facilities for all interaction:

Event handling in guienv is handled through defining virtual further bindings in which the actions to be executed as the result of an event, is specified. Each interfaceObject type defined a series of event virtuels in the eventhandler virtual pattern, and users of these interfaceObjects may then further bind this eventhandler, and in this further binding specify the actions to be executed for the particuler events, defined for that type of interfaceObject.

The basic eventhandler (defined in interfaceObject) defines the following events: onMouseDown, onMouseUp, onKeyDown, onRefresh, onActivate, and onDeactivate. Some of these events carry global information on the state of the keyboard and mouse.

In order to support more dynamic event handling, it is also possible dynamically to attach actions before or after the predefined actions for an event. This is done by specifying an instance of (a subpattern of) action and then either prepend or append it to the already attached actions (using the prependAction or appendAction operations). An action can be retracted again by the deleteAction operation.

Parallel to the event hierarchy is an action hierarchy. An action (e.g. mouseDownAction and refreshAction) can be associated with an event, such that the actions will be invoked either before or after the events itself. These actions are defined in separate libraries, see chapters 10-12.

In order to control the interfaceObject's sensibility to individuel event types, the operations enableEventType and disableEventType are available.

3.1 Event handling

One of the strengths of the Lidskjalv libraries is the ease with which the event handling is conducted. Essentially, the Lidskjalv libraries takes care of all the details of the event dispatching and handling. The Lidskjalv libraries essentially converts all event occurrences into invocation of special virtual patterns within the appropriate user interface object (e.g. the one below the mouse pointer). In the Lidskjalv documentation, these virtual patterns are often referred to as the event patterns (or simply events). The application programmer only has to further bind these event patterns of the individual user interface objects to specify the actions to be taken in response to user interaction.


Lidskjalv: User Interface Framework - Reference Manual
© 1994-2002 Mjølner Informatics
[Modified: Monday October 23rd 2000 at 9:41]