Fix 'template' keyword in list item factories

This commit is contained in:
James Westman 2023-05-13 20:15:28 -05:00
parent 5a782c653b
commit 46e467bbfb
7 changed files with 30 additions and 13 deletions

View file

@ -4,7 +4,7 @@ Gtk.ListView {
factory: Gtk.BuilderListItemFactory list_item_factory {
template ListItem {
child: Label {
label: "Hello";
label: bind template.item as <$MyObject>.name;
};
}
};

View file

@ -9,7 +9,13 @@
<template class="GtkListItem">
<property name="child">
<object class="GtkLabel">
<property name="label">Hello</property>
<binding name="label">
<lookup name="name" type="MyObject">
<lookup name="item" type="GtkListItem">
<constant>GtkListItem</constant>
</lookup>
</lookup>
</binding>
</object>
</property>
</template>