ยค Drawing, atomicD, et al

Drawing

Types

data Drawing lbl leaf = AtomicD leaf
                      | LabelD lbl (Drawing lbl leaf)
                      | AttribD GCSpec (Drawing lbl leaf)
                      | SpacedD Spacer (Drawing lbl leaf)
                      | PlacedD Placer (Drawing lbl leaf)
                      | ComposedD Int [Drawing lbl leaf]
                      | CreateHardAttribD GCtx
                                          [GCAttributes ColorSpec FontSpec]
                                          (GCtx -> Drawing lbl leaf)
instance Graphic leaf => Graphic (Drawing annot leaf)
instance Functor (Drawing lbl)
instance (Show leaf, Show lbl) => Show (Drawing lbl leaf)

atomicD :: leaf -> Drawing lbl leaf
labelD :: lbl -> Drawing lbl leaf -> Drawing lbl leaf

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.

Example

 vboxD [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: labelF, displayF, hyperGraphicsF, ...

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.