GtkSignalListItemFactory

GtkSignalListItemFactory — A listitem factory providing signals

Signals

void bind Run First
void setup Run First
void teardown Run First
void unbind Run First

Types and Values

Object Hierarchy

    GObject
    ╰── GtkListItemFactory
        ╰── GtkSignalListItemFactory

Includes

#include <gtk/gtk.h>

Description

GtkSignalListItemFactory is a GtkListItemFactory that provides signals that user code can connect to to manage listitems. Signals are emitted for every listitem in the same order:

  1. “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. “bind” is emitted to bind the item passed via “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. “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. “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.

    1. “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 g_object_freeze_notify() for details.

For tracking changes in other properties in the GtkListItem, the “notify” signal is recommended. The signal can be connected in the “setup” signal and removed again during “teardown”.

Functions

gtk_signal_list_item_factory_new ()

GtkListItemFactory *
gtk_signal_list_item_factory_new (void);

Creates a new GtkSignalListItemFactory. You need to connect signal handlers before you use it.

Returns

a new GtkSignalListItemFactory

Types and Values

GtkSignalListItemFactory

typedef struct _GtkSignalListItemFactory GtkSignalListItemFactory;

The object for the GtkSignalListItemFactory.

Signal Details

The “bind” signal

void
user_function (GtkSignalListItemFactory *self,
               GtkListItem              *listitem,
               gpointer                  user_data)

The ::bind signal is emitted when a new GtkListItem: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 GtkListView or other list widget.

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

Parameters

self

The GtkSignalListItemFactory

 

listitem

The GtkListItem to bind

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “setup” signal

void
user_function (GtkSignalListItemFactory *self,
               GtkListItem              *listitem,
               gpointer                  user_data)

The ::setup signal is emitted when a new listitem has been created and needs to be setup for use. It is the first signal emitted for every listitem.

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

Parameters

self

The GtkSignalListItemFactory

 

listitem

The GtkListItem to set up

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “teardown” signal

void
user_function (GtkSignalListItemFactory *self,
               GtkListItem              *listitem,
               gpointer                  user_data)

The ::teardown signal is emitted when a listitem is about to be destroyed. It is the last signal ever emitted for this listitem .

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

Parameters

self

The GtkSignalListItemFactory

 

listitem

The GtkListItem to teardown

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “unbind” signal

void
user_function (GtkSignalListItemFactory *self,
               GtkListItem              *listitem,
               gpointer                  user_data)

The ::unbind signal is emitted when a listitem has been removed from use in a list widget and its new GtkListItem:item is about to be unset.

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

Parameters

self

The GtkSignalListItemFactory

 

listitem

The GtkListItem to unbind

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First