Support <closure> for GtkBuilder
GTK4 GtkBuilder has support for expressions, like:
<binding name="label">
<closure type="gchararray" function="format_label">
<constant type="gchararray">This window is %s</constant>
<constant type="gchararray">active</constant>
<lookup name="is-active">ListDemoCWindow</lookup>
</closure>
</binding>
Then the function needs to be bound via gtk_widget_class_bind_template_callback()
. In Vala currently this fails with:
../../../../../../../../../Projects/list-demo-vala/src/window.vala:8.5-8.31: error: could not find signal for handler `format_label'
private string format_label (string format, string adj, bool flag) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Test case: https://gitlab.gnome.org/exalm/vala-closures-bug-test-case
There are c
and vala
branches with the same demo in C and Vala. The C one compiles, the Vala one doesn't.
Edited by Alice Mikhaylenko