¤ Drawing, DPath, et al

Types

data Drawing b a = AtomicD a | LabelD b (Drawing b a) | AttribD GCSpec (Drawing b a) | SpacedD Spacer (Drawing b a) | PlacedD Placer (Drawing b a) | ComposedD Int [Drawing b a]
instance (Graphic b) => Graphic (Drawing a b)
type DPath = [Int]
atomicD :: a -> Drawing b a
labelD :: a -> Drawing a b -> Drawing a b
up :: DPath -> DPath

Description

The values of type Drawing label leaf are compositions of simple graphical objects into a tree structure using layout combinators.

The function atomicD constructs atomic drawings (leaves). The leaves can be of arbitrary type, but are required to be in the class Graphic by fudgets that display drawings. By using the type Gfx you can mix different types of leaves in the same drawing.

Nodes in the tree can be labelled with values of an arbitrary type label using the function labelD.

A node in a drawing can specify drawing attributes that are inherited by the children of that node. Drawing attributes can be specified in various ways.

Values of type DPath are used as references to parts of drawings. The function up returns the path of the parent of a node.

Example

 vhboxD [atomicD "Yes",atomicD "No"]

See Also

Composing drawings: hboxD, vboxD et al.

Specifying drawing attributes: attribD et al.

Functions on parts of drawings: drawingPart, replacePart et al.

The class Graphic, the type Gfx.

Fudgets that display graphics: hyperGraphicsF, graphicsF, graphicsDispF, graphicsLabelF, ...

Bugs

The type Drawing will probably be made abstract. Don't use the constructors directly when constructing drawings.

This page documents work progress. Information on this page is subject to change without notice and does not represent a commitment on the part of the Fudgets corporation.