Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data CustomPatch widget customData
- = CustomReplace
- | CustomModify (widget -> IO SomeState)
- | CustomKeep
- data CustomWidget widget customData event = CustomWidget {
- customWidget :: ManagedPtr widget -> widget
- customCreate :: customData -> IO SomeState
- customPatch :: SomeState -> customData -> customData -> CustomPatch widget customData
- customSubscribe :: customData -> widget -> (event -> IO ()) -> IO Subscription
- customData :: customData
Documentation
data CustomPatch widget customData Source #
Similar to Patch
, describing a possible action to perform on a
Widget
, decided by customPatch
.
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
.
CustomWidget | |
|
Instances
Functor (CustomWidget widget customData) Source # | |
Defined in GI.Gtk.Declarative.CustomWidget 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 # | |
Defined in GI.Gtk.Declarative.CustomWidget 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 # | |
Defined in GI.Gtk.Declarative.CustomWidget subscribe :: CustomWidget widget customData event -> SomeState -> (event -> IO ()) -> IO Subscription Source # |