1 Introduction

This document is an introduction to window programming in Mozart. Window programming means to build graphical and interactive interfaces for applications.

In Mozart, the basic building blocks for window programming are widgets: objects that represent graphical entities like labels, buttons, and menus. Windows are described compositionally by means of object hierarchies and are subject to dynamic and interactive modification. Other entities we will deal with are for example fonts and images. The appearance of widgets is managed by geometry managers. Interaction events, such as pressing a mouse button, trigger execution of procedures or methods.

Mozart uses an object-oriented interface to Tk for window programming. The interface inherits from Oz concurrency, objects and first-class procedures. From Tk the interface inherits a set of powerful graphical abstractions. This document introduces both aspects: the basic usage of the graphical abstractions and how to profit from Oz's language features. The interface employs a simple generic mapping to Tk. People familiar with Tk will get acquainted very soon.

The Examples

The documents features a large number of examples which are designed to be tried by the reader. All examples are contained in a demo file to be used with the ``The Oz Programming Interface''.

Further Information

One particular advantage of using Tk as graphics engine for Mozart is the wealth of excellent documentation for Tcl and Tk.

A must read (or at least see or browse) in this particular respect is the original book of John Ousterhout. A very fascinating account on how to employ the graphical primitives in Tk for developing high-level graphical applications is [HM98].

The definitive entry point into the full collection of Tcl/Tk related resources and informations is the web page at Scriptics, a company co-founded by John Ousterhout.

The details of all commands and widgets for Tcl and Tk can be found in the manpages that ship with the Tcl and Tk distributions. For convenience, the Mozart release includes HTML versions of them, which carry the following copyright.


I am grateful to Michael Mehl, who co-authored an earlier version of this document. Peter Van Roy contributed the paragraph in Section 5.3 that explains why tkReturn is indeed asynchronous.

Christian Schulte
Version 1.4.0 (20080702)