haskell-gi-base-0.15: Foundation for libraries generated by haskell-gi

Safe HaskellNone
LanguageHaskell98

Data.GI.Base.Signals

Description

Routines for connecting GObjects to signals.

Synopsis

Documentation

on :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> HaskellCallbackType info -> m SignalHandlerId Source

Same as connectSignal, specifying from the beginning that the handler is to be run before the default handler.

on = connectSignal SignalConnectBefore

after :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> HaskellCallbackType info -> m SignalHandlerId Source

Connect a signal to a handler, running the handler after the default one.

after = connectSignal SignalConnectAfter

data SignalProxy object info where Source

Support for overloaded signal connectors.

Constructors

SignalProxy :: SignalProxy o info 
PropertyNotify :: (info ~ ResolveAttribute propName o, AttrInfo info, pl ~ AttrLabel info) => AttrLabelProxy propName -> SignalProxy o (GObjectNotifySignalInfo pl) 

Instances

(HasSignal slot object, (~) * info (ResolveSignal slot object)) => IsLabelProxy slot (SignalProxy object info)

Support for overloaded labels.

data SignalConnectMode Source

Whether to connect a handler to a signal with connectSignal so that it runs before/after the default handler for the given signal.

Constructors

SignalConnectBefore

Run before the default handler.

SignalConnectAfter

Run after the default handler.

connectSignalFunPtr :: GObject o => o -> String -> FunPtr a -> SignalConnectMode -> IO SignalHandlerId Source

Connect a signal to a handler, given as a FunPtr.

type SignalHandlerId = CULong Source

Type of a GObject signal handler id.

class SignalInfo info where Source

Information about an overloaded signal.

Associated Types

type HaskellCallbackType info Source

Methods

connectSignal :: GObject o => SignalProxy o info -> o -> HaskellCallbackType info -> SignalConnectMode -> IO SignalHandlerId Source

Connect a Haskell function to a signal of the given GObject, specifying whether the handler will be called before or after the default handler.

Instances

data GObjectNotifySignalInfo propName Source

Connection information for a "notify" signal indicating that a specific property changed (see PropertyNotify for the relevant constructor).