gtk has a class DirectoryList which is a ListModel
of FileInfo
since FileInfo
doesn;t have properties i tried to use a function to get the filename:
ListView list_view {
factory: BuilderListItemFactory {
template ListItem {
child: Label {
label: bind $g_file_info_get_name((template.item as <Gtk.ListItem>).item as <Gio.FileInfo>) as <string>;
};
}
};
}
but when i create a Gtk.MultiSelection
with a Gtk.DirectoryList
in python and set it as the list_view
’s model , many of these errors (probably one for each file) are printed in the terminal:
AttributeError: 'ListItem' object has no attribute '__gtktemplate_methods__'
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/gi/_gtktemplate.py", line 63, in do_create_closure
if func_name not in current_object.__gtktemplate_methods__:
AttributeError: 'ListItem' object has no attribute '__gtktemplate_methods__'
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/gi/_gtktemplate.py", line 63, in do_create_closure
if func_name not in current_object.__gtktemplate_methods__:
what is python doing here?