craftwerk-gtk-0.1: Gtk UI for Craftwerk.

MaintainerMalte Harder <malte.harder@gmail.com>

Graphics.Craftwerk.UI.Gtk

Contents

Description

The UI functions of Craftwerk allow quick display of figures. They also support the creation of a simple user interface to control parameters of the figures that are displayed.

Synopsis

Data types

data Option Source

Describing options for a user interface.

Constructors

NumberOption Double 
RangeOption Double Double Double Double

A range: min, max, step and initial value.

BoolOption Bool 
ChoiceOption [String] Int

An option of choices with a default selection.

data RenderContext Source

Combined cairo and tikz rendering functions depending on the options.

Constructors

RenderContext 

Display figures

renderFigureSource

Arguments

:: Double

Width of the coordinate system of the GTK widget

-> Double

Height of the coordinate system of the GTK widget

-> (Map String Option -> IO Figure)

The render function

-> RenderContext 

Renders an 'IO Figure' into a render context with the given dimensions.

displayRender :: [(String, Option)] -> RenderContext -> IO ()Source

Display a render context in a Gtk window, starts the Gtk main loop. The first argument contains a list of named options whose UI values are passed to the render context.

displayMultiple :: [(String, Option)] -> [(String, RenderContext)] -> IO ()Source

Display multiple render contexts in a Gtk window, starts the Gtk main loop. The first argument contains a list of named options whose UI values are passed to the render context.

renderWindow :: [(String, Option)] -> [(String, RenderContext)] -> IO WindowSource

Same as displayMultiple except that the Gtk main loop is not started or initialized. The window is not visible upon return.

Option values