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

Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Declarative.Patch

Description

The central patching type class of this library.

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

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.

Methods

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.

Instances
Patchable Widget Source #

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

Instance details

Defined in GI.Gtk.Declarative.Widget

Patchable BoxChild Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Box

Patchable Pane Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Paned

Methods

create :: Pane e -> IO SomeState Source #

patch :: SomeState -> Pane e1 -> Pane e2 -> Patch Source #

Patchable MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

Patchable (SingleWidget widget) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

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

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

IsBin parent => Patchable (Bin parent) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

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

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

IsWidget widget => Patchable (CustomWidget widget customData) Source # 
Instance details

Defined in GI.Gtk.Declarative.CustomWidget

Methods

create :: CustomWidget widget customData e -> IO SomeState Source #

patch :: SomeState -> CustomWidget widget customData e1 -> CustomWidget widget customData e2 -> Patch Source #

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

Defined in GI.Gtk.Declarative.Container

Methods

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

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