Next Previous Up Top Contents Index

7.4 A tour of sheets

7.4.1 Basic properties of sheets

All sheets, including gadgets and layouts, have a number of properties that deal with the fairly low level implementation behavior of sheet classes. When developing basic DUIM applications, you do not need to be concerned with these properties for the most part, since gadgets and layouts have been designed so as to avoid the need for direct low level manipulation. However, if you design your own classes of sheet, you need to support these properties.

sheet-region

The sheet region is used to define the area of the screen that "belongs to" a sheet. This is essential for deciding in which sheet a particular event occurs. For example, the sheet-region for a gadget defines the area of the screen in which its callbacks are invoked, should an event occur.

The sheet region is expressed in the sheet's own coordinate system. It can be an instance of any concrete subclass of <region>, but is usually represented by the region class <bounding-box>.
The sheet-region is defined relative to the region of its parent, rather than an absolute region of the screen.
sheet-transform

This maps the sheet's coordinate system to the coordinate system of its parent. This is an instance of a concrete subclass of <transform>.
Providing the sheet transform means that you do not have to worry about the absolute screen position of any given element of an interface. Instead, you can specify its location relative to its parent in the sheet hierarchy. For example, you can arrange gadgets in an interface in terms of the layout that contains them, rather than in absolute terms.
sheet-parent

This is #f if the sheet has no parent, or another sheet otherwise. This slot is used to describe any hierarchy of sheets.

sheet-mapped?

This is a boolean that specifies whether the sheet is visible on a display, ignoring issues of occluding windows.

sheet-frame

This returns the frame a sheet belongs to.

Many sheet classes, such as <menu-bar> or <tool-bar>, have single or multiple children, in which case they have additional attributes:

sheet-children

The value of this slot is a sequence of sheets. Each sheet in the sequence is a child of the current sheet.

Methods to add, remove, and replace a child.

Methods to map over children.

Some classes of sheet -- usually gadgets -- can receive input. These have:

sheet-event-queue

This is a list of all the events currently queued and waiting for execution for a given sheet.
Methods for <handle-event>

Each class of sheet must have methods for <handle-event> defined, so that callbacks may be described for the sheet class.

Sheets that can be repainted have methods for handle-repaint. Sheets that can display output have a sheet-medium slot. As a guide, all gadgets can be repainted and can display output, and no layouts can be repainted or display output.


Building Applications Using DUIM - 26 May 1999

Next Previous Up Top Contents Index