The Mjølner System: Lidskjalv

Lidskjalv is a platform independent object-oriented user interface framework for: Lidskjalv realizes user interfaces of many different look-and-feels. Lidskjalv allows construction of portable user interfaces in such a way that the look-and-feel of the applications, will conform to the standardized look-and-feel of the specific platform.

The Toolkit defines abstractions for all commonly used interface objects, such as windows, menu bars, menus, buttons, text fields, figure items, scrolling lists, etc.

The application programmer does not have to handle user interaction at the event level of the underlying platform, because each interface object takes care of the interactions related to itself. It is the responsibility of the entire framework to ensure that the user interactions (such as mouse button presses, key presses, etc.) are converted internally into invocations of virtual procedures of the appropriate interface object. The only thing the application programmer needs to do is to bind the virtual procedures. All layout properties of interface objects can be manipulated through the Toolkit.

A realistic example of using Lidskjalv is presented in the following. It is a small text editor with full support for loading, editing, and saving files. The two screen snapshots show how this application appears on the screen on Windows NT and on Motif platforms after the program has loaded its own source text for editing, and with the menu opened.

Screen dump of TextEditor

ORIGIN  '~beta/guienv/fields';
INCLUDE '~beta/guienv/stddialogs' 
        '~beta/basiclib/file';
-- program: descriptor --
guienv
(# theWindow: @window
     (# menubarType::<
          (# fileMenu: @menu
               (# textFile: @file;
                  openItem: @menuitem
                    (# eventHandler::<
                         (# onSelect::<
                              (# theText: @StyledText;
                              do theWindow[] -> fileSelectionDialog -> textFile.name;
                                 textFile.openRead;
                                 textFile.scan
                                   (# while::< (# do true->value #) do ch -> theText.put #);
                                 theText[]->theTextEditor.contents.contents;
                                 textFile.close;
                         #)#);
                       open::< (# do 'Open' -> name #);
                    #);
                  saveItem: @menuitem
                    (# eventHandler::<
                         (# onSelect::<
                              (# theText: @Text;
                              do textFile.openWrite;
                                 theTextEditor.contents.contents->textFile.puttext;
                                 textFile.close;
                         #)#);
                       open::< (# do 'Save' -> name #);
                    #);
                  quitItem: @menuitem
                    (# eventHandler::< (# onSelect::< (# do Terminate #) #);
                       open::< (# do 'Quit' -> name #);
                    #);
                  open::<
                    (# 
                    do 'File' -> name;
                       openItem.open; openItem[] -> append;
                       saveItem.open; saveItem[] -> append;
                       quitItem.open; quitItem[] -> append;
               #)#);
             open::< (# do fileMenu.open; fileMenu[] -> append #);
          #);
        thetextEditor: @textEditor
          (# open::< (# do theWindow.size -> Size; True -> bindBottom; True -> bindRight #)#);
        open::< (# do thetextEditor.open #);
     #);

More Information

For further information, see
Mjølner System: Lidskjalv - Tutorial.
Mjølner System: Lidskjalv - Reference Manual.

Lidskjalv is the throne (or high seat) of the Nordic God Odin. From here he can see out into all worlds and see everything that happens. Other Gods may also use this throne, e.g. it was from this throne that Frey, the brother of Freja, saw Gerd with whom he fell hopefully in love.