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

Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Declarative.CustomWidget

Description

While you can instantiate Patchable and EventSource for your own data types, it's a bit complicated. The CustomWidget data type takes care of some lower-level detail, so that you can focus on the custom behavior of your widget. You still need to think about and implement a patching function, but in an easier way.

Synopsis

Documentation

data CustomPatch widget customData Source #

Similar to Patch, describing a possible action to perform on a Widget, decided by customPatch.

Constructors

CustomReplace 
CustomModify (widget -> IO SomeState) 
CustomKeep 

data CustomWidget widget customData event Source #

A custom widget specification, with all functions needed to instantiate Patchable and EventSource. A custom widget is based on a top widget, can use customData as a way of passing parameters, and emits events of type event.

Constructors

CustomWidget 

Fields

Instances
Functor (CustomWidget widget customData) Source # 
Instance details

Defined in GI.Gtk.Declarative.CustomWidget

Methods

fmap :: (a -> b) -> CustomWidget widget customData a -> CustomWidget widget customData b #

(<$) :: a -> CustomWidget widget customData b -> CustomWidget widget customData a #

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 #

GObject widget => EventSource (CustomWidget widget customData) Source # 
Instance details

Defined in GI.Gtk.Declarative.CustomWidget

Methods

subscribe :: CustomWidget widget customData event -> SomeState -> (event -> IO ()) -> IO Subscription Source #