Drawing, atomicD, et al



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] | CreateHardAttribD GCtx [GCAttributes ColorSpec FontSpec] (GCtx -> Drawing b a)
  instance (Graphic b) => Graphic (Drawing a b)
  instance (Show b, Show a) => Show (Drawing a b)
atomicD :: a -> Drawing b a
labelD :: a -> Drawing a b -> Drawing a b


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.


 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, ...


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.