I have the following in KV language (simplified example): My issue is with the last line (on_release).
#:import Factory kivy.factory.Factory
<MyCustomWidgets>:
ListView:
id: my_listview
<MainScreen>:
Button:
text: "Choose File"
on_release: Factory.FileChooserDialog().open()
MyCustomWidgets:
<FileChooserDialog@ModalView>:
FileChooserIconView:
id: filechooser
Button:
text: "OK"
on_release: app.root.add_to_listview("Sample Text", app.root.ids.my_listview)
In Python, I have:
class MainScreen(BoxLayout):
def add_to_listview(self, thelistview):
# For testing purposes.
print(type(thelistview))
In KV, on the last line, I'm trying to run a python method which adds a string to a ListView
that has an id of my_listview
.
I get this error:
AttributeError: 'super' object has no attribute '__getattr__'