mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Fix template types
This commit is contained in:
parent
64879491a1
commit
88f5b4f1c7
14 changed files with 120 additions and 21 deletions
5
tests/samples/template_binding.blp
Normal file
5
tests/samples/template_binding.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
template MyTemplate : Box {
|
||||
prop1: bind MyTemplate.prop2 as ($MyObject).prop3;
|
||||
}
|
13
tests/samples/template_binding.ui
Normal file
13
tests/samples/template_binding.ui
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<template class="MyTemplate" parent="GtkBox">
|
||||
<binding name="prop1">
|
||||
<lookup name="prop3" type="MyObject">
|
||||
<lookup name="prop2" type="MyTemplate">
|
||||
<constant>MyTemplate</constant>
|
||||
</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</template>
|
||||
</interface>
|
5
tests/samples/template_binding_extern.blp
Normal file
5
tests/samples/template_binding_extern.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
template MyTemplate : $MyParentClass {
|
||||
prop1: bind MyTemplate.prop2 as ($MyObject).prop3;
|
||||
}
|
13
tests/samples/template_binding_extern.ui
Normal file
13
tests/samples/template_binding_extern.ui
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<template class="MyTemplate" parent="MyParentClass">
|
||||
<binding name="prop1">
|
||||
<lookup name="prop3" type="MyObject">
|
||||
<lookup name="prop2" type="MyTemplate">
|
||||
<constant>MyTemplate</constant>
|
||||
</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</template>
|
||||
</interface>
|
|
@ -187,6 +187,12 @@ class TestSamples(unittest.TestCase):
|
|||
self.assert_sample(
|
||||
"template", skip_run=True
|
||||
) # The template class doesn't exist
|
||||
self.assert_sample(
|
||||
"template_binding", skip_run=True
|
||||
) # The template class doesn't exist
|
||||
self.assert_sample(
|
||||
"template_binding_extern", skip_run=True
|
||||
) # The template class doesn't exist
|
||||
self.assert_sample(
|
||||
"template_no_parent", skip_run=True
|
||||
) # The template class doesn't exist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue