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 callbacks.
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) => AttrLabelProxy (attr :: Symbol) -> setValue -> Attribute widget event
- Classes :: IsWidget widget => ClassSet -> Attribute widget event
- OnSignalPure :: (GObject widget, SignalInfo info, callback ~ HaskellCallbackType info, Functor (PureCallback callback), ToGtkCallback (PureCallback callback), callback ~ CustomGtkCallback (PureCallback callback)) => SignalProxy widget info -> PureCallback callback event -> Attribute widget event
- OnSignalImpure :: (GObject widget, SignalInfo info, callback ~ HaskellCallbackType info, Functor (ImpureCallback callback widget), ToGtkCallback (ImpureCallback callback widget), (widget -> callback) ~ CustomGtkCallback (ImpureCallback callback widget)) => SignalProxy widget info -> ImpureCallback callback widget event -> Attribute widget event
- classes :: IsWidget widget => [Text] -> Attribute widget event
- on :: (GObject widget, SignalInfo info, callback ~ HaskellCallbackType info, pure ~ ToPureCallback callback event, Functor (PureCallback callback), ToGtkCallback (PureCallback callback), callback ~ CustomGtkCallback (PureCallback callback)) => SignalProxy widget info -> pure -> Attribute widget event
- onM :: (GObject widget, SignalInfo info, callback ~ HaskellCallbackType info, impure ~ ToImpureCallback callback event, withWidget ~ (widget -> impure), Functor (ImpureCallback callback widget), ToGtkCallback (ImpureCallback callback widget), (widget -> callback) ~ CustomGtkCallback (ImpureCallback callback widget)) => SignalProxy widget info -> withWidget -> Attribute widget event
- class ToGtkCallback userCallback where
- type CustomGtkCallback userCallback :: *
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) => 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, callback ~ HaskellCallbackType info, Functor (PureCallback callback), ToGtkCallback (PureCallback callback), callback ~ CustomGtkCallback (PureCallback callback)) => SignalProxy widget info -> PureCallback callback event -> Attribute widget event | Emit events using a pure callback. Use the 'on function instead of this constructor directly. |
OnSignalImpure :: (GObject widget, SignalInfo info, callback ~ HaskellCallbackType info, Functor (ImpureCallback callback widget), ToGtkCallback (ImpureCallback callback widget), (widget -> callback) ~ CustomGtkCallback (ImpureCallback callback widget)) => SignalProxy widget info -> ImpureCallback callback widget event -> Attribute widget event | Emit events using an impure callback. Use the 'on function instead of this constructor directly. |
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, callback ~ HaskellCallbackType info, pure ~ ToPureCallback callback event, Functor (PureCallback callback), ToGtkCallback (PureCallback callback), callback ~ CustomGtkCallback (PureCallback callback)) => SignalProxy widget info -> pure -> Attribute widget event Source #
Emit events, using a pure callback, by subcribing to the specified signal.
onM :: (GObject widget, SignalInfo info, callback ~ HaskellCallbackType info, impure ~ ToImpureCallback callback event, withWidget ~ (widget -> impure), Functor (ImpureCallback callback widget), ToGtkCallback (ImpureCallback callback widget), (widget -> callback) ~ CustomGtkCallback (ImpureCallback callback widget)) => SignalProxy widget info -> withWidget -> Attribute widget event Source #
Emit events, using an impure callback receiving the widget
and returning
an IO
action of event
, by subcribing to the specified signal.
Callbacks
class ToGtkCallback userCallback where Source #
Internal class for converting user callbacks to gi-gtk callbacks.
type CustomGtkCallback userCallback :: * Source #
toGtkCallback :: userCallback event -> (event -> IO ()) -> CustomGtkCallback userCallback Source #
Converts a user callback, i.e. a pure or an impure callback, back to a GTK+ callback.