mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add lookup expressions
This commit is contained in:
parent
c094743e84
commit
4fefa0bd73
8 changed files with 177 additions and 5 deletions
9
tests/samples/expr_lookup.blp
Normal file
9
tests/samples/expr_lookup.blp
Normal file
|
@ -0,0 +1,9 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Overlay {
|
||||
Label label {}
|
||||
}
|
||||
|
||||
Label {
|
||||
label: bind (label.parent).child.label;
|
||||
}
|
20
tests/samples/expr_lookup.ui
Normal file
20
tests/samples/expr_lookup.ui
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkOverlay">
|
||||
<child>
|
||||
<object class="GtkLabel" id="label"></object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkLabel">
|
||||
<binding name="label">
|
||||
<lookup name="label">
|
||||
<lookup name="child">
|
||||
<lookup name="parent">
|
||||
<constant>label</constant>
|
||||
</lookup>
|
||||
</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</interface>
|
|
@ -136,6 +136,7 @@ class TestSamples(unittest.TestCase):
|
|||
self.assert_sample("combo_box_text")
|
||||
self.assert_sample("comments")
|
||||
self.assert_sample("enum")
|
||||
self.assert_sample("expr_lookup")
|
||||
self.assert_sample("file_filter")
|
||||
self.assert_sample("flags")
|
||||
self.assert_sample("id_prop")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue