Method

GioSettingsbind_with_mapping

since: 2.26

Declaration

void
g_settings_bind_with_mapping (
  GSettings* settings,
  const gchar* key,
  GObject* object,
  const gchar* property,
  GSettingsBindFlags flags,
  GSettingsBindGetMapping get_mapping,
  GSettingsBindSetMapping set_mapping,
  gpointer user_data,
  GDestroyNotify destroy
)

Description

Create a binding between the key in the settings object and the property property of object.

The binding uses the provided mapping functions to map between settings and property values.

Note that the lifecycle of the binding is tied to object, and that you can have only one binding per object property. If you bind the same property twice on the same object, the second binding overrides the first one.

Available since: 2.26

This method is not directly available to language bindings.

The implementation of this method is provided by g_settings_bind_with_mapping_closures() in language bindings

Parameters

key

Type: const gchar*

The key to bind.

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

Type: GObject

A GObject.

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

Type: const gchar*

The name of the property to bind.

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

Type: GSettingsBindFlags

Flags for the binding.

get_mapping

Type: GSettingsBindGetMapping

A function that gets called to convert values from settings to object, or NULL to use the default GIO mapping.

set_mapping

Type: GSettingsBindSetMapping

A function that gets called to convert values from object to settings, or NULL to use the default GIO mapping.

user_data

Type: gpointer

Data that gets passed to get_mapping and set_mapping.

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

Type: GDestroyNotify

GDestroyNotify function for user_data.