gi-gtk-declarative-0.1.0: Declarative GTK+ programming in Haskell

Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Declarative.Patch

Synopsis

Documentation

data Patch Source #

A possible action to take on an existing Widget, decided by the patch method when comparing declarative widgets.

Constructors

Modify (Widget -> IO ())

An IO action to apply to a Widget to make it reflect an updated declarative widget. The action to apply is calculated from the difference between the old and the new declarative widget.

Replace (IO Widget)

Replace the current Widget by the widget returned by the IO action.

Keep

Do nothing, i.e. keep the Widget as it is.

class Patchable widget where Source #

A patchable widget is one that can create an underlying GTK widget, or calculate a Patch to be applied to an existing GTK widget that was previously created.

Minimal complete definition

create, patch

Methods

create :: widget e -> IO Widget Source #

Given a declarative widget that is Patchable, return an IO action that can create a new corresponding Widget. The created widget should be use in corresponding patch modifications, until it is replaced.

patch :: widget e1 -> widget e2 -> Patch Source #

Given two declarative widgets of the same widget type (but not necessarily of the same event types,) calculate a Patch.

Instances
Patchable Widget Source #

Widget is itself patchable, by delegating to the underlying widget instances.

Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

create :: Widget e -> IO Widget0 Source #

patch :: Widget e1 -> Widget e2 -> Patch Source #

Patchable BoxChild Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Box

Methods

create :: BoxChild e -> IO Widget Source #

patch :: BoxChild e1 -> BoxChild e2 -> Patch Source #

Patchable (SingleWidget widget) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

create :: SingleWidget widget e -> IO Widget Source #

patch :: SingleWidget widget e1 -> SingleWidget widget e2 -> Patch Source #

(BinChild parent child, Patchable child) => Patchable (Bin parent child) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

create :: Bin parent child e -> IO Widget Source #

patch :: Bin parent child e1 -> Bin parent child e2 -> Patch Source #