### Function

# Adw bind_property_to_css_class_full

unstable since: 1.10

#### Declaration [src]

    AdwCssClassBinding*
    adw_bind_property_to_css_class_full (
      GObject* source,
      const char* source_property,
      GtkWidget* target,
      const char* target_css_class,
      GBindingFlags flags,
      AdwCssClassBindingMapToClassFunc map_to_class,
      AdwCssClassBindingMapToPropertyFunc map_to_property,
      gpointer user_data,
      GDestroyNotify notify
    )

#### Description [src]

Creates a binding between a property on `source` and a CSS class on `target` with a custom mapping.

Complete version of `adw_bind_property_to_css_class()`.

Whenever `source_property` is changed the `target_css_class` is toggled either on or off on `target` using the boolean value of `source_property`.

For instance:

    adw_bind_property_to_css_class (action, "active", widget, "active-widget", 0);

will result in the `active-widget` CSS class on the widget instance being applied when `active` is `TRUE`, and `active-widget` being removed when `active` is `FALSE`.

The binding will automatically be removed when either the `source` or `target` instances are finalized. To remove the binding without affecting the `source` or `target`, call `g_object_unref()` on the returned binding. It is recommended to only call `g_object_unref()` when it is clear that both `source` and `target` will outlive the binding.

This function is not thread safe. A source can have multiple bindings.

Available since: 1.10

This function is not directly available to language bindings.

The implementation of this function is provided by `adw_bind_property_to_css_class_with_closures()` in language bindings.

#### Parameters

`source`

  Type: `GObject`

  The source object.

  The data is owned by the caller of the function.

`source_property`

  Type: `const char*`

  The property on `source` to bind.

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

`target`

  Type: `GtkWidget`

  The target widget.

  The data is owned by the caller of the function.

`target_css_class`

  Type: `const char*`

  The CSS class on `target` to bind.

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

`flags`

  Type: `GBindingFlags`

  Flags to pass to `self`.

`map_to_class`

  Type: `AdwCssClassBindingMapToClassFunc`

  the mapping function from the `source_property` to a boolean value, or `NULL` to use the default.

  The argument can be `NULL`.

`map_to_property`

  Type: `AdwCssClassBindingMapToPropertyFunc`

  the mapping function from the `target_css_class` to a value, or `NULL` to use the default.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  Custom data to be passed to `map_to_class` and `map_to_property`.

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

`notify`

  Type: `GDestroyNotify`

  A function to call when disposing the binding, to free resources used by `map_to_class` and `map_to_property`.

  The argument can be `NULL`.

#### Return value

Type: `AdwCssClassBinding`

The new binding.

The data is owned by the called function.