Function

Adw-1Adwbind_property_to_css_classSince 1.10

  • Creates a binding between a property on source and a CSS class on target.

    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 GObject.Object.unref on the returned binding. It is recommended to only call 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: Adw.bind_property_to_css_class_full.

    Parameters

    • source: GObject.Object

      the source object

    • source_property: string

      the property on source to bind

    • target: Gtk.Widget

      the target widget

    • target_css_class: string

      the CSS class on target to bind

    • flags: GObject.BindingFlags

      flags to pass to self

    Returns Adw.CssClassBinding

    the new binding

    1.10