mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
Add lambda expressions
This commit is contained in:
parent
012bdf6843
commit
fc497ac9e6
18 changed files with 247 additions and 80 deletions
9
tests/samples/lambda.blp
Normal file
9
tests/samples/lambda.blp
Normal file
|
@ -0,0 +1,9 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Gtk.BoolFilter filter {
|
||||
expression: (Gtk.Label object) => object.visible;
|
||||
}
|
||||
|
||||
Gtk.BoolFilter {
|
||||
expression: (Gtk.Label object) => filter.invert;
|
||||
}
|
16
tests/samples/lambda.ui
Normal file
16
tests/samples/lambda.ui
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBoolFilter" id="filter">
|
||||
<property name="expression">
|
||||
<lookup name="visible" type="GtkLabel"/>
|
||||
</property>
|
||||
</object>
|
||||
<object class="GtkBoolFilter">
|
||||
<property name="expression">
|
||||
<lookup name="invert">
|
||||
<constant>filter</constant>
|
||||
</lookup>
|
||||
</property>
|
||||
</object>
|
||||
</interface>
|
3
tests/samples/template_custom_parent.blp
Normal file
3
tests/samples/template_custom_parent.blp
Normal file
|
@ -0,0 +1,3 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
template MyWidget : .MyBaseWidget {}
|
5
tests/samples/template_custom_parent.ui
Normal file
5
tests/samples/template_custom_parent.ui
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<template class="MyWidget" parent="MyBaseWidget"></template>
|
||||
</interface>
|
Loading…
Add table
Add a link
Reference in a new issue