Fix template types

This commit is contained in:
James Westman 2023-03-28 10:41:42 -05:00
parent 64879491a1
commit 88f5b4f1c7
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
14 changed files with 120 additions and 21 deletions

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
template MyTemplate : Box {
prop1: bind MyTemplate.prop2 as ($MyObject).prop3;
}

View 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>

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
template MyTemplate : $MyParentClass {
prop1: bind MyTemplate.prop2 as ($MyObject).prop3;
}

View 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>

View file

@ -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