gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.SignalListItemFactory

Contents

- Exported types
- Methods
  - new
- Signals
  - bind
  - setup
  - teardown
  - unbind

Description

Emits signals to manage listitems.

Signals are emitted for every listitem in the same order:

1. SignalListItemFactory::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.
2. SignalListItemFactory::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.
3. SignalListItemFactory::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.
4. SignalListItemFactory::bind and SignalListItemFactory::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 one.
5. SignalListItemFactory::teardown is emitted to allow undoing the effects of SignalListItemFactory::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 listitems 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 notify signal is recommended. The signal can be connected in the SignalListItemFactory::setup signal and removed again during SignalListItemFactory::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 SignalListItemFactoryBindCallback = Object -> IO ()
- afterSignalListItemFactoryBind :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactoryBindCallback) -> m SignalHandlerId
- onSignalListItemFactoryBind :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactoryBindCallback) -> m SignalHandlerId
- type SignalListItemFactorySetupCallback = Object -> IO ()
- afterSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactorySetupCallback) -> m SignalHandlerId
- onSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactorySetupCallback) -> m SignalHandlerId
- type SignalListItemFactoryTeardownCallback = Object -> IO ()
- afterSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactoryTeardownCallback) -> m SignalHandlerId
- onSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactoryTeardownCallback) -> m SignalHandlerId
- type SignalListItemFactoryUnbindCallback = Object -> IO ()
- afterSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactoryUnbindCallback) -> m SignalHandlerId
- onSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: a) => SignalListItemFactoryUnbindCallback) -> m SignalHandlerId

# Exported types

newtype SignalListItemFactory Source #

Memory-managed wrapper type.

Constructors

SignalListItemFactory (ManagedPtr SignalListItemFactory) |

#### Instances

Instances details

Eq SignalListItemFactory Source # |
Instance details Defined in GI.Gtk.Objects.SignalListItemFactory Methods (==) :: SignalListItemFactory -> SignalListItemFactory -> Bool Source # (/=) :: SignalListItemFactory -> SignalListItemFactory -> Bool Source #
GObject SignalListItemFactory Source # |
Instance details Defined in GI.Gtk.Objects.SignalListItemFactory
ManagedPtrNewtype SignalListItemFactory Source # |
Instance details Defined in GI.Gtk.Objects.SignalListItemFactory Methods toManagedPtr :: SignalListItemFactory -> ManagedPtr SignalListItemFactory Source #
TypedObject SignalListItemFactory Source # |
Instance details Defined in GI.Gtk.Objects.SignalListItemFactory Methods glibType :: IO GType Source #
HasParentTypes SignalListItemFactory Source # |
Instance details Defined in GI.Gtk.Objects.SignalListItemFactory
IsGValue (Maybe SignalListItemFactory) Source # | Convert `SignalListItemFactory` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.SignalListItemFactory Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe SignalListItemFactory -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe SignalListItemFactory) Source #
type ParentTypes SignalListItemFactory Source # |
Instance details Defined in GI.Gtk.Objects.SignalListItemFactory type ParentTypes SignalListItemFactory = '[ListItemFactory, Object]

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

Instances details

(GObject o, IsDescendantOf SignalListItemFactory o) => IsSignalListItemFactory o Source # |
Instance details 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

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## new

signalListItemFactoryNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m SignalListItemFactory | Returns: a new `GtkSignalListItemFactory`

Creates a new `GtkSignalListItemFactory`.

You need to connect signal handlers before you use it.

# Signals

## bind

type SignalListItemFactoryBindCallback Source #

Arguments

= Object | `object`: The `GObject` to bind
-> IO () |

Emitted when an object has been bound to an item.

The handler for this signal must set to populate the listitem with widgets.

After this signal was emitted, the object might be shown in a `ListView` or other widget.

The SignalListItemFactory::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 -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onSignalListItemFactoryBind :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: 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

## setup

type SignalListItemFactorySetupCallback Source #

Arguments

= Object | `object`: the `GObject` to set up
-> IO () |

Emitted when a newly created listitem needs to be prepared for use.

It is the first signal emitted for every listitem.

The handler for this signal must call `listItemSetChild` to populate the listitem with widgets.

The SignalListItemFactory::teardown signal is the opposite of this signal and can be used to undo everything done in this signal.

afterSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onSignalListItemFactorySetup :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: 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

## teardown

type SignalListItemFactoryTeardownCallback Source #

Arguments

= Object | `object`: The `GObject` to tear down
-> IO () |

Emitted when an object is about to be destroyed.

It is the last signal ever emitted for this `object`.

This signal is the opposite of the SignalListItemFactory::setup signal and should be used to undo everything done in that signal.

afterSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onSignalListItemFactoryTeardown :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: 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

## unbind

type SignalListItemFactoryUnbindCallback Source #

Arguments

= Object | `object`: The `GObject` to unbind
-> IO () |

Emitted when an object has been unbound from its item.

This happens for example when a listitem was removed from use in a list widget and its ListItem:item is about to be unset.

This signal is the opposite of the SignalListItemFactory::bind signal and should be used to undo everything done in that signal.

afterSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: 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

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onSignalListItemFactoryUnbind :: (IsSignalListItemFactory a, MonadIO m) => a -> ((?self :: 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