1.178 <GtkSignalListItemFactory>

Class: <GtkSignalListItemFactory>

It derives from <GtkListItemFactory>.

Emits signals to manage listitems.

Signals are emitted for every listitem in the same order:

  1. signal-list-item-factory: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.
  1. signal-list-item-factory:bind is emitted to bind the item passed via list-item: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.
  1. signal-list-item-factory: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.
  1. signal-list-item-factory:bind and signal-list-item-factory: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.
  1. signal-list-item-factory:teardown is emitted to allow undoing the effects of signal-list-item-factory: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 object:freeze-notify for details.

For tracking changes in other properties in the listitem, the ::notify signal is recommended. The signal can be connected in the signal-list-item-factory:setup signal and removed again during signal-list-item-factory:teardown.

Procedures

Procedure: signal-list-item-factory:new ⇒ %return

Creates a new <GtkSignalListItemFactory>.

You need to connect signal handlers before you use it.

%return

Returned: a <GtkListItemFactory>.

a new <GtkSignalListItemFactory>

Signals

Signal: signal-list-item-factory:bind

Connect a handler with (connect object signal-list-item-factory:bind handler). It is called as (handler self object).

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 <GtkListView> or other widget.

The signal-list-item-factory:unbind signal is the opposite of this signal and can be used to undo everything done in this signal.

self

Passed: a <GtkSignalListItemFactory>.

object

Passed: a <GObject>.

The <GObject> to bind

Signal: signal-list-item-factory:setup

Connect a handler with (connect object signal-list-item-factory:setup handler). It is called as (handler self object).

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 list-item:set-child to populate the listitem with widgets.

The signal-list-item-factory:teardown signal is the opposite of this signal and can be used to undo everything done in this signal.

self

Passed: a <GtkSignalListItemFactory>.

object

Passed: a <GObject>.

the <GObject> to set up

Signal: signal-list-item-factory:teardown

Connect a handler with (connect object signal-list-item-factory:teardown handler). It is called as (handler self object).

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 signal-list-item-factory:setup signal and should be used to undo everything done in that signal.

self

Passed: a <GtkSignalListItemFactory>.

object

Passed: a <GObject>.

The <GObject> to tear down

Signal: signal-list-item-factory:unbind

Connect a handler with (connect object signal-list-item-factory:unbind handler). It is called as (handler self object).

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 list-item:item is about to be unset.

This signal is the opposite of the signal-list-item-factory:bind signal and should be used to undo everything done in that signal.

self

Passed: a <GtkSignalListItemFactory>.

object

Passed: a <GObject>.

The <GObject> to unbind