bind_property_to_css_class


Description:

[ CCode ( cname = "adw_bind_property_to_css_class_with_closures" ) ]
[ Version ( since = "1.10" ) ]
public unowned CssClassBinding bind_property_to_css_class (Object source, string source_property, Widget target, string target_css_class, BindingFlags flags, CssClassBindingMapToClassFunc? map_to_class = null, CssClassBindingMapToPropertyFunc? map_to_property = null)

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

This function is the language bindings friendly version of [func@Adw.bind_property_to_css_class_full].

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 [method@GObject.Object.unref] on the returned binding. It is recommended to only call [method@GObject.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.

See also: [func@Adw.bind_property_to_css_class].

Parameters:

source

the source object

source_property

the property on source to bind

target

the target widget

target_css_class

the CSS class on target to bind

flags

flags to pass to self

map_to_class

a closure wrapping the source_property to boolean value map, or `NULL` to use the default

map_to_property

a closure wrapping the target_css_class to [struct@GObject.Value] map, or `NULL` to use the default

Returns:

the new binding


Namespace: Adw
Package: libadwaita-1