add_setter
Description:
Adds a setter to this.
The setter will automatically set property
on object
to value
when applying the breakpoint, and set it
back to its original value upon unapplying it.
Note that setting properties to their original values does not work for properties that have irreversible side effects. For example, changing [ property@Gtk.Button:label] while [property@Gtk.Button:icon-name] is set will reset the icon. However, resetting the label will not set icon-name to its original value.
Use the [signal@Breakpoint:AdwBreakpoint:apply
] and [signal@Breakpoint:AdwBreakpoint:unapply
] signals for those
properties instead, as follows:
```c static void breakpoint_apply_cb (MyWidget *self) { gtk_button_set_icon_name (self->button, "go-previous-symbolic"); }
static void breakpoint_apply_cb (MyWidget *self) { gtk_button_set_label (self->button, _("_Back")); }
// ...
g_signal_connect_swapped (breakpoint, "apply", G_CALLBACK (breakpoint_apply_cb), self); g_signal_connect_swapped (breakpoint, "unapply", G_CALLBACK (breakpoint_unapply_cb), self); ```
Parameters:
this |
a breakpoint |
object |
the target object |
property |
the target property |
value |
the value to set |