expressions: Add closure expressions

This commit is contained in:
James Westman 2022-04-30 13:27:54 -05:00
parent 762a29b705
commit cc1d2ab78f
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
6 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkBox">
<child>
<object class="GtkBox" id="box"></object>
</child>
</object>
<object class="GtkStack">
<binding name="visible-child">
<lookup name="parent" type="GtkButton">
<closure function="my_closure" type="GtkButton">
<lookup name="parent">
<constant>box</constant>
</lookup>
</closure>
</lookup>
</binding>
<binding name="visible">
<closure function="my_other_closure" type="gboolean">
<constant>box</constant>
</closure>
</binding>
</object>
</interface>