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

Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Declarative

Description

The declarative layer on top of GTK+ lets you describe your user interface as a declarative hierarchy of objects, using data structures and pure functions. You can leverage the declarative event handling to build reusable widgets. The Patch typeclass, and the instances provided by this library, performs minimal updates to GTK+ widgets using the underlying imperative operations, so that your rendering can always be a pure function your state to a Widget.

Synopsis

Documentation

data EventHandler gtkEventHandler widget (purity :: Purity) event where Source #

Encodes the user event handler in such a way that we can have a Functor instance for arity-polymorphic event handlers.

Constructors

PureEventHandler :: EventHandlerReturn Identity ret e -> EventHandler (IO ret) w Pure e 
ImpureEventHandler :: (w -> EventHandlerReturn IO ret e) -> EventHandler (IO ret) w Impure e 
EventHandlerFunction :: (a -> EventHandler b w p e) -> EventHandler (a -> b) w p e 
Instances
Functor (EventHandler gtkEventHandler widget purity) Source # 
Instance details

Defined in GI.Gtk.Declarative.Attributes.Internal.EventHandler

Methods

fmap :: (a -> b) -> EventHandler gtkEventHandler widget purity a -> EventHandler gtkEventHandler widget purity b #

(<$) :: a -> EventHandler gtkEventHandler widget purity b -> EventHandler gtkEventHandler widget purity a #

type ClassSet = HashSet Text Source #

A set of CSS classes.

data Attribute widget event where Source #

The attribute GADT represent a supported attribute for a declarative widget. This extends the regular notion of GTK+ attributes to also include event handling and CSS classes.

Constructors

(:=) :: (AttrOpAllowed AttrConstruct info widget, AttrOpAllowed AttrSet info widget, AttrGetC info widget attr getValue, AttrSetTypeConstraint info setValue, KnownSymbol attr, Typeable attr, Eq setValue, Typeable setValue) => AttrLabelProxy (attr :: Symbol) -> setValue -> Attribute widget event

An attribute/value mapping for a declarative widget. The AttrLabelProxy is parameterized by attr, which represents the GTK-defined attribute name. The underlying GI object needs to support the construct, get, and set operations for the given attribute.

Classes :: IsWidget widget => ClassSet -> Attribute widget event

Defines a set of CSS classes for the underlying widget's style context. Use the classes function instead of this constructor directly.

OnSignalPure :: (GObject widget, SignalInfo info, gtkCallback ~ HaskellCallbackType info, ToGtkCallback gtkCallback Pure) => SignalProxy widget info -> EventHandler gtkCallback widget Pure event -> Attribute widget event

Emit events using a pure event handler. Use the on function, instead of this constructor directly.

OnSignalImpure :: (GObject widget, SignalInfo info, gtkCallback ~ HaskellCallbackType info, ToGtkCallback gtkCallback Impure) => SignalProxy widget info -> EventHandler gtkCallback widget Impure event -> Attribute widget event

Emit events using a pure event handler. Use the on function, instead of this constructor directly.

AfterCreated :: (widget -> IO ()) -> Attribute widget event

Provide a callback to modify the widget after it's been created.

Instances
Functor (Attribute widget) Source #

Attributes have a Functor instance that maps events in all event handler.

Instance details

Defined in GI.Gtk.Declarative.Attributes

Methods

fmap :: (a -> b) -> Attribute widget a -> Attribute widget b #

(<$) :: a -> Attribute widget b -> Attribute widget a #

classes :: IsWidget widget => [Text] -> Attribute widget event Source #

Define the CSS classes for the underlying widget's style context. For these classes to have any effect, this requires a CssProvider with CSS files loaded, to be added to the GDK screen. You probably want to do this in your entry point when setting up GTK.

on :: (GObject widget, SignalInfo info, gtkCallback ~ HaskellCallbackType info, ToGtkCallback gtkCallback Pure, ToEventHandler gtkCallback widget Pure, userEventHandler ~ UserEventHandler gtkCallback widget Pure event) => SignalProxy widget info -> userEventHandler -> Attribute widget event Source #

Emit events, using a pure event handler, by subcribing to the specified signal.

onM :: (GObject widget, SignalInfo info, gtkCallback ~ HaskellCallbackType info, ToGtkCallback gtkCallback Impure, ToEventHandler gtkCallback widget Impure, userEventHandler ~ UserEventHandler gtkCallback widget Impure event) => SignalProxy widget info -> userEventHandler -> Attribute widget event Source #

Emit events, using an impure event handler receiving the widget and returning an IO action of event, by subcribing to the specified signal.

afterCreated :: (widget -> IO ()) -> Attribute widget event Source #

Provide a EventHandler to modify the widget after it's been created.

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

Methods

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

Methods

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

Methods

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

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

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 FromWidget widget event target | target -> event where Source #

Convert a widget to a target type. This is deliberately unconstrained in it's types, and is used by smart constructors to implement return type polymorphism, so that a smart contructor can return either a Widget, or some specifically typed MarkupOf, depending on the context in which it's used.

Minimal complete definition

fromWidget

Methods

fromWidget :: (Typeable widget, Typeable event) => widget event -> target Source #

Instances
FromWidget Widget event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

fromWidget :: Widget event -> Widget event Source #

(Typeable widget, Functor (SingleWidget widget)) => FromWidget (SingleWidget widget) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> Widget event Source #

(Typeable widget, Functor (SingleWidget widget)) => FromWidget (SingleWidget widget) event (Markup event ()) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> Markup event () Source #

FromWidget (SingleWidget widget) event (MarkupOf (SingleWidget widget) event ()) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> MarkupOf (SingleWidget widget) event () Source #

(BinChild widget child, Typeable widget, Patchable child, EventSource child, Functor (Bin widget child)) => FromWidget (Bin widget child) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Widget event Source #

(Typeable widget, Typeable children, Patchable (Container widget children), EventSource (Container widget children), Functor (Container widget children)) => FromWidget (Container widget children) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Widget event Source #

(BinChild widget child, a ~ (), Typeable widget, Patchable child, EventSource child, Functor (Bin widget child)) => FromWidget (Bin widget child) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Markup event a Source #

(a ~ (), Typeable widget, Typeable children, Patchable (Container widget children), EventSource (Container widget children), Functor (Container widget children)) => FromWidget (Container widget children) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Markup event a Source #

FromWidget (Bin widget child) event (Bin widget child event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Bin widget child event Source #

a ~ () => FromWidget (Bin widget child) event (MarkupOf (Bin widget child) event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> MarkupOf (Bin widget child) event a Source #

FromWidget (Container widget children) event (Container widget children event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Container widget children event Source #

a ~ () => FromWidget (Container widget children) event (MarkupOf (Container widget children) event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> MarkupOf (Container widget children) event a Source #

type Markup event a = MarkupOf Widget event a Source #

Handy type alias for the common case of markup containing Widgets.

data MarkupOf widget event a Source #

The declarative markup builder, primarily for using its Monad instance and do notation to construct adjacent widgets in containers.

It is parameterized with widget and event, such that containers can restrict the type of their children to other types than Widget.

Note that the return type, a, is not used in this library. It's a more a technical necessity to have the Monad instance. You can still use it if you need to return a value from a markup function, though.

Instances
(Typeable widget, Functor (SingleWidget widget)) => FromWidget (SingleWidget widget) event (Markup event ()) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> Markup event () Source #

FromWidget (SingleWidget widget) event (MarkupOf (SingleWidget widget) event ()) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> MarkupOf (SingleWidget widget) event () Source #

Monad (MarkupOf widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

(>>=) :: MarkupOf widget event a -> (a -> MarkupOf widget event b) -> MarkupOf widget event b #

(>>) :: MarkupOf widget event a -> MarkupOf widget event b -> MarkupOf widget event b #

return :: a -> MarkupOf widget event a #

fail :: String -> MarkupOf widget event a #

Functor (MarkupOf widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

fmap :: (a -> b) -> MarkupOf widget event a -> MarkupOf widget event b #

(<$) :: a -> MarkupOf widget event b -> MarkupOf widget event a #

Applicative (MarkupOf widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

pure :: a -> MarkupOf widget event a #

(<*>) :: MarkupOf widget event (a -> b) -> MarkupOf widget event a -> MarkupOf widget event b #

liftA2 :: (a -> b -> c) -> MarkupOf widget event a -> MarkupOf widget event b -> MarkupOf widget event c #

(*>) :: MarkupOf widget event a -> MarkupOf widget event b -> MarkupOf widget event b #

(<*) :: MarkupOf widget event a -> MarkupOf widget event b -> MarkupOf widget event a #

(BinChild widget child, a ~ (), Typeable widget, Patchable child, EventSource child, Functor (Bin widget child)) => FromWidget (Bin widget child) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Markup event a Source #

(a ~ (), Typeable widget, Typeable children, Patchable (Container widget children), EventSource (Container widget children), Functor (Container widget children)) => FromWidget (Container widget children) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Markup event a Source #

a ~ () => FromWidget (Bin widget child) event (MarkupOf (Bin widget child) event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> MarkupOf (Bin widget child) event a Source #

a ~ () => FromWidget (Container widget children) event (MarkupOf (Container widget children) event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> MarkupOf (Container widget children) event a Source #

data Widget event where Source #

A Widget value wraps a Patchable and EventSource widget, providing a constrained equivalent of a Dynamic value. It is used to support heterogeneous containers of widgets, and to support equality checks on different types of widgets when calculating patches.

Constructors

Widget :: (Typeable widget, Patchable widget, Functor widget, EventSource widget) => widget event -> Widget event 
Instances
Functor Widget Source # 
Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

fmap :: (a -> b) -> Widget a -> Widget b #

(<$) :: a -> Widget b -> Widget a #

Patchable Widget Source #

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

Instance details

Defined in GI.Gtk.Declarative.Markup

EventSource Widget Source # 
Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

subscribe :: Widget event -> SomeState -> (event -> IO ()) -> IO Subscription Source #

BinChild Dialog Widget Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

BinChild ListBoxRow Widget Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

BinChild MenuItem Widget Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

BinChild ScrolledWindow Widget Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

BinChild Window Widget Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

FromWidget Widget event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Markup

Methods

fromWidget :: Widget event -> Widget event Source #

IsContainer ListBox (Bin ListBoxRow Widget) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Patch

Methods

appendChild :: ListBox -> Bin ListBoxRow Widget event -> Widget0 -> IO () Source #

replaceChild :: ListBox -> Bin ListBoxRow Widget event -> Int32 -> Widget0 -> Widget0 -> IO () Source #

(Typeable widget, Functor (SingleWidget widget)) => FromWidget (SingleWidget widget) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> Widget event Source #

(Typeable widget, Functor (SingleWidget widget)) => FromWidget (SingleWidget widget) event (Markup event ()) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> Markup event () Source #

(BinChild widget child, Typeable widget, Patchable child, EventSource child, Functor (Bin widget child)) => FromWidget (Bin widget child) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Widget event Source #

(Typeable widget, Typeable children, Patchable (Container widget children), EventSource (Container widget children), Functor (Container widget children)) => FromWidget (Container widget children) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Widget event Source #

(BinChild widget child, a ~ (), Typeable widget, Patchable child, EventSource child, Functor (Bin widget child)) => FromWidget (Bin widget child) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Markup event a Source #

(a ~ (), Typeable widget, Typeable children, Patchable (Container widget children), EventSource (Container widget children), Functor (Container widget children)) => FromWidget (Container widget children) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Markup event a Source #

runMarkup :: MarkupOf widget event () -> Vector (widget event) Source #

Run a MarkupOf builder and get its widgets.

single :: widget event -> MarkupOf widget event () Source #

Construct markup from a single widget.

multiple :: Vector (widget event) -> MarkupOf widget event () Source #

Construct markup from multiple widgets.

data BoxChild event Source #

Described a child widget to be added with boxAppend to a Box.

Constructors

BoxChild 

Fields

Instances
Functor BoxChild Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Box

Methods

fmap :: (a -> b) -> BoxChild a -> BoxChild b #

(<$) :: a -> BoxChild b -> BoxChild a #

Patchable BoxChild Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Box

EventSource BoxChild Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Box

Methods

subscribe :: BoxChild event -> SomeState -> (event -> IO ()) -> IO Subscription Source #

IsContainer Box BoxChild Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Patch

Methods

appendChild :: Box -> BoxChild event -> Widget -> IO () Source #

replaceChild :: Box -> BoxChild event -> Int32 -> Widget -> Widget -> IO () Source #

boxChild :: Bool -> Bool -> Word32 -> Widget event -> MarkupOf BoxChild event () Source #

Construct a box child with the given boxAppend parameters.

data SingleWidget widget event Source #

Declarative version of a leaf widget, i.e. a widget without any children.

Instances
Functor (SingleWidget widget) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fmap :: (a -> b) -> SingleWidget widget a -> SingleWidget widget b #

(<$) :: a -> SingleWidget widget b -> SingleWidget widget a #

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 #

EventSource (SingleWidget widget) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

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

(Typeable widget, Functor (SingleWidget widget)) => FromWidget (SingleWidget widget) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> Widget event Source #

(Typeable widget, Functor (SingleWidget widget)) => FromWidget (SingleWidget widget) event (Markup event ()) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> Markup event () Source #

FromWidget (SingleWidget widget) event (MarkupOf (SingleWidget widget) event ()) Source # 
Instance details

Defined in GI.Gtk.Declarative.SingleWidget

Methods

fromWidget :: SingleWidget widget event -> MarkupOf (SingleWidget widget) event () Source #

widget Source #

Arguments

:: (Typeable widget, Typeable event, Functor (Attribute widget), IsWidget widget, FromWidget (SingleWidget widget) event target) 
=> (ManagedPtr widget -> widget)

A widget constructor from the underlying gi-gtk library.

-> Vector (Attribute widget event)

List of Attributes.

-> target

The target, whose type is decided by FromWidget.

Construct a leaf widget, i.e. one without any children.

data Bin widget child event Source #

Declarative version of a bin widget, i.e. a widget with exactly one child.

Instances
IsContainer ListBox (Bin ListBoxRow Widget) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.Patch

Methods

appendChild :: ListBox -> Bin ListBoxRow Widget event -> Widget0 -> IO () Source #

replaceChild :: ListBox -> Bin ListBoxRow Widget event -> Int32 -> Widget0 -> Widget0 -> IO () Source #

Functor (Bin widget child) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fmap :: (a -> b) -> Bin widget child a -> Bin widget child b #

(<$) :: a -> Bin widget child b -> Bin widget child a #

(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 SomeState Source #

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

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

Defined in GI.Gtk.Declarative.Bin

Methods

subscribe :: Bin parent child event -> SomeState -> (event -> IO ()) -> IO Subscription Source #

(BinChild widget child, Typeable widget, Patchable child, EventSource child, Functor (Bin widget child)) => FromWidget (Bin widget child) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Widget event Source #

(BinChild widget child, a ~ (), Typeable widget, Patchable child, EventSource child, Functor (Bin widget child)) => FromWidget (Bin widget child) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Markup event a Source #

FromWidget (Bin widget child) event (Bin widget child event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> Bin widget child event Source #

a ~ () => FromWidget (Bin widget child) event (MarkupOf (Bin widget child) event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Bin

Methods

fromWidget :: Bin widget child event -> MarkupOf (Bin widget child) event a Source #

bin Source #

Arguments

:: (Patchable (Bin widget child), Typeable widget, Typeable child, Typeable event, Functor child, IsContainer widget, IsBin widget, IsWidget widget, FromWidget (Bin widget child) event target) 
=> (ManagedPtr widget -> widget)

A bin widget constructor from the underlying gi-gtk library.

-> Vector (Attribute widget event)

List of Attributes.

-> child event

The bin's child widget, whose type is decided by the BinChild instance.

-> target

The target, whose type is decided by FromWidget.

Construct a bin widget, i.e. a widget with exactly one child.

data Container widget children event Source #

Declarative version of a container widget, i.e. a widget with zero or more child widgets. The type of children is parameterized, and differs across the supported container widgets, as some containers require specific types of child widgets. These type relations are decided by IsContainer, and instances can found in GI.Gtk.Declarative.Container.Patch.

Instances
Functor (Container widget children) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fmap :: (a -> b) -> Container widget children a -> Container widget children b #

(<$) :: a -> Container widget children b -> Container widget children a #

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

(Typeable child, EventSource child) => EventSource (Container widget (Children child)) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

subscribe :: Container widget (Children child) event -> SomeState -> (event -> IO ()) -> IO Subscription Source #

(Typeable widget, Typeable children, Patchable (Container widget children), EventSource (Container widget children), Functor (Container widget children)) => FromWidget (Container widget children) event (Widget event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Widget event Source #

(a ~ (), Typeable widget, Typeable children, Patchable (Container widget children), EventSource (Container widget children), Functor (Container widget children)) => FromWidget (Container widget children) event (Markup event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Markup event a Source #

FromWidget (Container widget children) event (Container widget children event) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> Container widget children event Source #

a ~ () => FromWidget (Container widget children) event (MarkupOf (Container widget children) event a) Source # 
Instance details

Defined in GI.Gtk.Declarative.Container

Methods

fromWidget :: Container widget children event -> MarkupOf (Container widget children) event a Source #

container Source #

Arguments

:: (Patchable (Container widget (Children child)), Typeable widget, Typeable child, Typeable event, Functor child, IsWidget widget, IsContainer widget, FromWidget (Container widget (Children child)) event target) 
=> (ManagedPtr widget -> widget)

A container widget constructor from the underlying gi-gtk library.

-> Vector (Attribute widget event)

List of Attributes.

-> MarkupOf child event ()

The container's child widgets, in a MarkupOf builder.

-> target

The target, whose type is decided by FromWidget.

Construct a container widget, i.e. a widget with zero or more children.

data MenuItem event Source #

Instances
Functor MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

Methods

fmap :: (a -> b) -> MenuItem a -> MenuItem b #

(<$) :: a -> MenuItem b -> MenuItem a #

Patchable MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

EventSource MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

Methods

subscribe :: MenuItem event -> SomeState -> (event -> IO ()) -> IO Subscription Source #

IsContainer Menu MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

Methods

appendChild :: Menu -> MenuItem event -> Widget -> IO () Source #

replaceChild :: Menu -> MenuItem event -> Int32 -> Widget -> Widget -> IO () Source #

IsContainer MenuBar MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

Methods

appendChild :: MenuBar -> MenuItem event -> Widget -> IO () Source #

replaceChild :: MenuBar -> MenuItem event -> Int32 -> Widget -> Widget -> IO () Source #

IsContainer MenuShell MenuItem Source # 
Instance details

Defined in GI.Gtk.Declarative.Container.MenuItem

Methods

appendChild :: MenuShell -> MenuItem event -> Widget -> IO () Source #

replaceChild :: MenuShell -> MenuItem event -> Int32 -> Widget -> Widget -> IO () Source #

menuItem :: (IsMenuItem item, Typeable event, BinChild item Widget, Typeable item, IsContainer item, IsBin item, IsWidget item) => (ManagedPtr item -> item) -> Vector (Attribute item event) -> Widget event -> MarkupOf MenuItem event () Source #

subMenu :: Typeable event => Text -> MarkupOf MenuItem event () -> MarkupOf MenuItem event () Source #