Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
SignalListItemFactory
is a ListItemFactory
that provides signals
that user code can connect to to manage listitems.
Signals are emitted for every listitem in the same order:
- setup is emitted to set up permanent things on the listitem. This usually means constructing the widgets used in the row and adding them to the listitem.
- bind is emitted to bind the item passed via
ListItem
:item
to the widgets that have been created in step 1 or to add item-specific widgets. Signals are connected to listen to changes - both to changes in the item to update the widgets or to changes in the widgets to update the item. After this signal has been called, the listitem may be shown in a list widget. - unbind is emitted to undo everything done in step 2. Usually this means disconnecting signal handlers. Once this signal has been called, the listitem will no longer be used in a list widget.
- bind and unbind may be emitted multiple times again to bind the listitem for use with new items. By reusing listitems, potentially costly setup can be avoided. However, it means code needs to make sure to properly clean up the listitem in step 3 so that no information from the previous use leaks into the next use.
- teardown is emitted to allow undoing the effects of setup. After this signal was emitted on a listitem, the listitem will be destroyed and not be used again.
Note that during the signal emissions, changing properties on the
GtkListItems
passed will not trigger notify signals as the listitem's
notifications are frozen. See objectFreezeNotify
for details.
For tracking changes in other properties in the ListItem
, the
ListItem
::notify
signal is recommended. The signal can be connected
in the setup signal and removed again during
teardown.
Synopsis
- newtype SignalListItemFactory = SignalListItemFactory (ManagedPtr SignalListItemFactory)
- class (GObject o, IsDescendantOf SignalListItemFactory o) => IsSignalListItemFactory o
- toSignalListItemFactory :: (MonadIO m, IsSignalListItemFactory o) => o -> m SignalListItemFactory
- signalListItemFactoryNew :: (HasCallStack, MonadIO m) => m SignalListItemFactory
- type C_SignalListItemFactoryBindCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO ()
- type SignalListItemFactoryBindCallback = ListItem -> IO ()
- afterSignalListItemFactoryBind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryBindCallback -> m SignalHandlerId
- genClosure_SignalListItemFactoryBind :: MonadIO m => SignalListItemFactoryBindCallback -> m (GClosure C_SignalListItemFactoryBindCallback)
- mk_SignalListItemFactoryBindCallback :: C_SignalListItemFactoryBindCallback -> IO (FunPtr C_SignalListItemFactoryBindCallback)
- noSignalListItemFactoryBindCallback :: Maybe SignalListItemFactoryBindCallback
- onSignalListItemFactoryBind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryBindCallback -> m SignalHandlerId
- wrap_SignalListItemFactoryBindCallback :: SignalListItemFactoryBindCallback -> C_SignalListItemFactoryBindCallback
- type C_SignalListItemFactorySetupCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO ()
- type SignalListItemFactorySetupCallback = ListItem -> IO ()
- afterSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactorySetupCallback -> m SignalHandlerId
- genClosure_SignalListItemFactorySetup :: MonadIO m => SignalListItemFactorySetupCallback -> m (GClosure C_SignalListItemFactorySetupCallback)
- mk_SignalListItemFactorySetupCallback :: C_SignalListItemFactorySetupCallback -> IO (FunPtr C_SignalListItemFactorySetupCallback)
- noSignalListItemFactorySetupCallback :: Maybe SignalListItemFactorySetupCallback
- onSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactorySetupCallback -> m SignalHandlerId
- wrap_SignalListItemFactorySetupCallback :: SignalListItemFactorySetupCallback -> C_SignalListItemFactorySetupCallback
- type C_SignalListItemFactoryTeardownCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO ()
- type SignalListItemFactoryTeardownCallback = ListItem -> IO ()
- afterSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryTeardownCallback -> m SignalHandlerId
- genClosure_SignalListItemFactoryTeardown :: MonadIO m => SignalListItemFactoryTeardownCallback -> m (GClosure C_SignalListItemFactoryTeardownCallback)
- mk_SignalListItemFactoryTeardownCallback :: C_SignalListItemFactoryTeardownCallback -> IO (FunPtr C_SignalListItemFactoryTeardownCallback)
- noSignalListItemFactoryTeardownCallback :: Maybe SignalListItemFactoryTeardownCallback
- onSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryTeardownCallback -> m SignalHandlerId
- wrap_SignalListItemFactoryTeardownCallback :: SignalListItemFactoryTeardownCallback -> C_SignalListItemFactoryTeardownCallback
- type C_SignalListItemFactoryUnbindCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO ()
- type SignalListItemFactoryUnbindCallback = ListItem -> IO ()
- afterSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryUnbindCallback -> m SignalHandlerId
- genClosure_SignalListItemFactoryUnbind :: MonadIO m => SignalListItemFactoryUnbindCallback -> m (GClosure C_SignalListItemFactoryUnbindCallback)
- mk_SignalListItemFactoryUnbindCallback :: C_SignalListItemFactoryUnbindCallback -> IO (FunPtr C_SignalListItemFactoryUnbindCallback)
- noSignalListItemFactoryUnbindCallback :: Maybe SignalListItemFactoryUnbindCallback
- onSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryUnbindCallback -> m SignalHandlerId
- wrap_SignalListItemFactoryUnbindCallback :: SignalListItemFactoryUnbindCallback -> C_SignalListItemFactoryUnbindCallback
Exported types
newtype SignalListItemFactory Source #
Memory-managed wrapper type.
SignalListItemFactory (ManagedPtr SignalListItemFactory) |
Instances
class (GObject o, IsDescendantOf SignalListItemFactory o) => IsSignalListItemFactory o Source #
Type class for types which can be safely cast to SignalListItemFactory
, for instance with toSignalListItemFactory
.
Instances
(GObject o, IsDescendantOf SignalListItemFactory o) => IsSignalListItemFactory o Source # | |
Defined in GI.Gtk.Objects.SignalListItemFactory |
toSignalListItemFactory :: (MonadIO m, IsSignalListItemFactory o) => o -> m SignalListItemFactory Source #
Cast to SignalListItemFactory
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata.
Setters
new
signalListItemFactoryNew Source #
:: (HasCallStack, MonadIO m) | |
=> m SignalListItemFactory | Returns: a new |
Creates a new SignalListItemFactory
. You need to connect signal
handlers before you use it.
Signals
bind
type C_SignalListItemFactoryBindCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type SignalListItemFactoryBindCallback Source #
The bind signal is emitted when a new ListItem
:item
has been set
on the listitem
and should be bound for use.
After this signal was emitted, the listitem might be shown in a ListView
or other list widget.
The unbind signal is the opposite of this signal and can be used to undo everything done in this signal.
afterSignalListItemFactoryBind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryBindCallback -> m SignalHandlerId Source #
Connect a signal handler for the bind signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
signalListItemFactory #bind callback
genClosure_SignalListItemFactoryBind :: MonadIO m => SignalListItemFactoryBindCallback -> m (GClosure C_SignalListItemFactoryBindCallback) Source #
Wrap the callback into a GClosure
.
mk_SignalListItemFactoryBindCallback :: C_SignalListItemFactoryBindCallback -> IO (FunPtr C_SignalListItemFactoryBindCallback) Source #
Generate a function pointer callable from C code, from a C_SignalListItemFactoryBindCallback
.
noSignalListItemFactoryBindCallback :: Maybe SignalListItemFactoryBindCallback Source #
A convenience synonym for
.Nothing
:: Maybe
SignalListItemFactoryBindCallback
onSignalListItemFactoryBind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryBindCallback -> m SignalHandlerId Source #
Connect a signal handler for the bind signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
signalListItemFactory #bind callback
wrap_SignalListItemFactoryBindCallback :: SignalListItemFactoryBindCallback -> C_SignalListItemFactoryBindCallback Source #
setup
type C_SignalListItemFactorySetupCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactorySetupCallback -> m SignalHandlerId Source #
Connect a signal handler for the setup signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
signalListItemFactory #setup callback
genClosure_SignalListItemFactorySetup :: MonadIO m => SignalListItemFactorySetupCallback -> m (GClosure C_SignalListItemFactorySetupCallback) Source #
Wrap the callback into a GClosure
.
mk_SignalListItemFactorySetupCallback :: C_SignalListItemFactorySetupCallback -> IO (FunPtr C_SignalListItemFactorySetupCallback) Source #
Generate a function pointer callable from C code, from a C_SignalListItemFactorySetupCallback
.
noSignalListItemFactorySetupCallback :: Maybe SignalListItemFactorySetupCallback Source #
A convenience synonym for
.Nothing
:: Maybe
SignalListItemFactorySetupCallback
onSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactorySetupCallback -> m SignalHandlerId Source #
Connect a signal handler for the setup signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
signalListItemFactory #setup callback
wrap_SignalListItemFactorySetupCallback :: SignalListItemFactorySetupCallback -> C_SignalListItemFactorySetupCallback Source #
teardown
type C_SignalListItemFactoryTeardownCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryTeardownCallback -> m SignalHandlerId Source #
Connect a signal handler for the teardown signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
signalListItemFactory #teardown callback
genClosure_SignalListItemFactoryTeardown :: MonadIO m => SignalListItemFactoryTeardownCallback -> m (GClosure C_SignalListItemFactoryTeardownCallback) Source #
Wrap the callback into a GClosure
.
mk_SignalListItemFactoryTeardownCallback :: C_SignalListItemFactoryTeardownCallback -> IO (FunPtr C_SignalListItemFactoryTeardownCallback) Source #
Generate a function pointer callable from C code, from a C_SignalListItemFactoryTeardownCallback
.
noSignalListItemFactoryTeardownCallback :: Maybe SignalListItemFactoryTeardownCallback Source #
A convenience synonym for
.Nothing
:: Maybe
SignalListItemFactoryTeardownCallback
onSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryTeardownCallback -> m SignalHandlerId Source #
Connect a signal handler for the teardown signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
signalListItemFactory #teardown callback
wrap_SignalListItemFactoryTeardownCallback :: SignalListItemFactoryTeardownCallback -> C_SignalListItemFactoryTeardownCallback Source #
unbind
type C_SignalListItemFactoryUnbindCallback = Ptr () -> Ptr ListItem -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryUnbindCallback -> m SignalHandlerId Source #
Connect a signal handler for the unbind signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
signalListItemFactory #unbind callback
genClosure_SignalListItemFactoryUnbind :: MonadIO m => SignalListItemFactoryUnbindCallback -> m (GClosure C_SignalListItemFactoryUnbindCallback) Source #
Wrap the callback into a GClosure
.
mk_SignalListItemFactoryUnbindCallback :: C_SignalListItemFactoryUnbindCallback -> IO (FunPtr C_SignalListItemFactoryUnbindCallback) Source #
Generate a function pointer callable from C code, from a C_SignalListItemFactoryUnbindCallback
.
noSignalListItemFactoryUnbindCallback :: Maybe SignalListItemFactoryUnbindCallback Source #
A convenience synonym for
.Nothing
:: Maybe
SignalListItemFactoryUnbindCallback
onSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> SignalListItemFactoryUnbindCallback -> m SignalHandlerId Source #
Connect a signal handler for the unbind signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
signalListItemFactory #unbind callback