Chapter 1

Introduction

This manual describes the MrEd GUI toolbox for programmers developing MrEd applications. It assumes familiarity with MzScheme as described in PLT MzScheme: Language Manual, the class.ss library of MzLib (which defines the class and interface system), and basic GUI concepts (such as windows and events).

What is MrEd?

MrEd is a Scheme implementation based on MzScheme (see PLT MzScheme: Language Manual). MrEd embeds MzScheme and extends it with a graphical user interface (GUI) toolbox. GUI applications written with MrEd run without modification under Windows, Mac OS, and Unix/X.

MrEd is not a graphical environment for developing Scheme programs. DrScheme, documented in PLT DrScheme: Development Environment Manual, is the development environment for producing MzScheme- and MrEd-based applications.1

Toolbox Organization

For documentation purposes, the MrEd toolbox is organized into three parts:

These three parts roughly represent layers of increasing sophistication. Simple GUI programs access only the windowing toolbox directly, more complex programs use both the windowing and drawing toolboxes, and large-scale applications rely on all three toolboxes.2

All three parts are immediately available when MrEd is started, as well as the base class system from MzLib. The mred.ss library module of the mred collection provides all of the class, interface, and procedure names defined in this manual. When MrEd starts up, it imports the mred.ss module and MzLib's class.ss module into the initial namespace (so no knowledge about modules is required to understand this manual).

The module #%mred-kernel is built into the MrEd executable, and intended for use only by mred.ss. Attempting to require mred.ss in a plain MzScheme executable will result in a run-time error, because #%mred-kernel will not be available.

To create a namespace in which the mred.ss module will be used, call the make-namespace-with-mred procedure. That procedure attaches the mred.ss instance of the current namespace to the created namespace. Otherwise, different namespaces create different instances of the mred.ss module, which in turn generate distinct classes.


1 DrScheme is itself a MrEd-based application that is developed using DrScheme.

2 This three-layer view of the toolbox breaks down under close scrutiny, because the windowing, drawing, and editor toolboxes are actually interdependent and intertwined. Nevertheless, the layered separation is a good approximation.