Safe Haskell | None |
---|---|
Language | Haskell2010 |
Attribute lists on declarative objects, supporting the underlying attributes from Data.GI.Base.Attributes, along with CSS class lists, and pure and impure event EventHandlers.
Synopsis
- data Attribute widget event where
- (:=) :: (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
- Classes :: IsWidget widget => ClassSet -> Attribute widget event
- OnSignalPure :: (GObject widget, SignalInfo info, gtkCallback ~ HaskellCallbackType info, ToGtkCallback gtkCallback Pure) => SignalProxy widget info -> EventHandler gtkCallback widget Pure event -> Attribute widget event
- OnSignalImpure :: (GObject widget, SignalInfo info, gtkCallback ~ HaskellCallbackType info, ToGtkCallback gtkCallback Impure) => SignalProxy widget info -> EventHandler gtkCallback widget Impure event -> Attribute widget event
- classes :: IsWidget widget => [Text] -> Attribute widget event
- type ClassSet = HashSet Text
- 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
- 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
- data EventHandler gtkEventHandler widget (purity :: Purity) event where
- 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
Documentation
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.
(:=) :: (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
|
Classes :: IsWidget widget => ClassSet -> Attribute widget event | Defines a set of CSS classes for the underlying widget's style context.
Use the |
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 |
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 |
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.
Event Handling
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.
EventHandlers
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.
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 # | |
Defined in GI.Gtk.Declarative.Attributes.Internal.EventHandler fmap :: (a -> b) -> EventHandler gtkEventHandler widget purity a -> EventHandler gtkEventHandler widget purity b # (<$) :: a -> EventHandler gtkEventHandler widget purity b -> EventHandler gtkEventHandler widget purity a # |