3 Overview of Lidskjalv

Lidskjalv contain many different patterns for implementing advanced (and simple) applications utilizing the graphical user interface system. It is impossible in this tutorial to give all details of these patterns and the presentation here will therefore only stress the most important patterns and the most important attributes of each pattern, along with illustrative examples.

Since there are many patterns and a somewhat elaborate pattern hierarchy, the following figure will show the most important classes and their super/subpattern relations.

[3kb 417x170 GIF]

4 Access to Global Structures

Lidskjalv offers access to several global objects of the window system, such as the mouse, the clipboard, the menubar, etc.

4.1 Access to the Mouse

The Mouse attribute in Guienv provides access to the physical mouse connected to the window system. Mouse.globalPosition returns the current position of the mouse (in screen coordinates). Mouse.buttonState returns the status of the mouse buttons and returns 1, 2, or 3 if the corresponding mouse button is currently pressed, and 0 otherwise.

4.2 Access to the Clipboard

The clipboard attribute in Guienv gives direct access to the underlying window system clipboard.

clipboard.hasText returns true, if the clipboard containg textual information. If txt[] is a reference to text object, then txt[]->clipboard.textContents places the text in txt[] onto the clipboard, and clipboard.textContents-> txt[] copies the contents of the clipboard as text into txt[]. To clear the clipboard, you can invoke clipboard.clearContents.

4.3 Standard Input and Output

In betaenv, the standard input and output from the user is obtained through the screen object (or through the putText, getText, etc. operations of betaenv).

Obtaining input and output through screen should however be used sparely in Lidskjalv since the facilities for input and output through Lidskjalv will conform to the user interface guidelines of the underlying window system and result in more elegant and powerful user interfaces.

In window-based environments there usually are two ways to invoke applications: either directly from some sort of console window (e.g. Xterm on UNIX platforms, MS-DOS Box on Windows 95 and Windows NT, and MPW Shell on Macintosh platforms), or by double-clicking on some graphical icon in the graphical user interface. Lidskjalv behaves different in these two cases with respect to handling standart input and outpu.

In Lidskjalv applications invoked through console windows, standard input and output will be obtained from the console window from which the application is invoked. In Lidskjalv applications invoked through the graphical user interface, a console window will be created by the application, and standard input and output will be obtained from this console window.

4.4 Coordinate System

Many aspects of the programming in Lidskjalv involves specifying positions on the desk-top of the underlying window system (i.e. the position and size of a window). Lidskjalv defines a point and rectangle pattern for representing such properties.

The coordinate system used in the specification of these positions etc. are having a horizontal X-axis with X increasing to the right, and the Y-axis is vertical with Y increasing downwards. In defining e.g. the size of a window, the terms width and height are used along the X-axis, respectively the Y-axis.

[2kb 358x108 GIF]

The screen of the underlying window system has the (0,0) positioned at the upper left corner of the screen. Windows on the desk-top also has the (0,0) positioned in the upper left corner of the window. In general,, the (0,0) position is located in the upper left corner of all interface objects.


Lidskjalv: User Interface Framework - Tutorial
© 1995-2002 Mjølner Informatics
[Modified: Friday October 27th 2000 at 14:56]