Function

GObjectsignal_connect_data

Declaration

gulong
g_signal_connect_data (
  GObject* instance,
  const gchar* detailed_signal,
  GCallback c_handler,
  gpointer data,
  GClosureNotify destroy_data,
  GConnectFlags connect_flags
)

Description

Connects a GCallback function to a signal for a particular object. Similar to g_signal_connect(), but allows to provide a GClosureNotify for the data which will be called when the signal handler is disconnected and no longer used. Specify connect_flags if you need ..._after() or ..._swapped() variants of this function.

This function cannot fail. If the given signal doesn’t exist, a critical warning is emitted.

This function is not directly available to language bindings.

Parameters

instance

Type: GObject

The instance to connect to.

The data is owned by the caller of the function.
detailed_signal

Type: const gchar*

A string of the form “signal-name::detail”.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
c_handler

Type: GCallback

The GCallback to connect.

data

Type: gpointer

Data to pass to c_handler calls.

The argument can be NULL.
The data is owned by the caller of the function.
destroy_data

Type: GClosureNotify

A GClosureNotify for data.

The argument can be NULL.
connect_flags

Type: GConnectFlags

A combination of GConnectFlags.

Return value

Type: gulong

The handler ID (always greater than 0)