gi-gtk-declarative-0.7.0: Declarative GTK+ programming in Haskell
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Declarative.State

Description

The StateTree and SomeState form a "shadow state" representation, used in patching. Declarative widgets can return, and later on reuse, its underlying GTK+ widget, collected properties and classes, style context, custom internal state, and child states. This reduces the need for querying GTK+ widgets excessively, and recalculating/resetting, greatly improving the performance of patching.

Synopsis

Documentation

data SomeState where Source #

A Dynamic-like container of a StateTree value.

Constructors

SomeState :: (IsWidget widget, Typeable widget, Typeable customState) => StateTree stateType widget child event customState -> SomeState 

data StateType Source #

The types of state trees that are available, matching the types of GTK+ widgets (single widget, bin, and container.)

data StateTree (stateType :: StateType) widget child event customState where Source #

A state tree for a specific widget. This is built up recursively to contain child state trees, for bin and container child widgets.

Constructors

StateTreeWidget :: !(StateTreeNode widget event customState) -> StateTree 'WidgetState widget child event customState 
StateTreeBin :: !(StateTreeNode widget event customState) -> SomeState -> StateTree 'BinState widget child event customState 
StateTreeContainer :: (IsContainer widget, IsContainer widget child) => !(StateTreeNode widget event customState) -> Vector SomeState -> StateTree 'ContainerState widget child event customState 

data StateTreeNode widget event customState Source #

The common structure for all state tree nodes.

Constructors

StateTreeNode 

Convenience accessor functions

stateTreeNode :: StateTree stateType widget child event customState -> StateTreeNode widget event customState Source #

Get the common state tree node information.

stateTreeNodeWidget :: StateTree stateType widget child event customState -> widget Source #

Get the specific type of GTK+ widget of a state tree.

someStateWidget :: SomeState -> IO Widget Source #

Get the GTK+ widget, cast to Widget, of some state tree.