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

Safe HaskellNone



The central patching type class of this library.



data Patch Source #

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


Modify (IO SomeState)

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 SomeState)

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


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


create :: widget e -> IO SomeState 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 :: SomeState -> 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.

Patchable Widget Source #

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

Instance details

Defined in GI.Gtk.Declarative.Markup

Patchable BoxChild Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Box

Patchable MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

Patchable (SingleWidget widget) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget


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

patch :: SomeState -> 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


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

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

(Patchable child, Typeable child, IsContainer container child) => Patchable (Container container (Children child)) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container


create :: Container container (Children child) e -> IO SomeState Source #

patch :: SomeState -> Container container (Children child) e1 -> Container container (Children child) e2 -> Patch Source #