Keep running into a error that says \"Attribute Error: \'None Type\' object has no attribute \'text\'. I have no idea where the problem is. Did a fair amount of research, but sa
You never set the value of text_input
, so it is still the default None
. Just setting an id doesn't set that attribute. There are a couple easy fixes here.
First, you can fill in that value:
<OptionMenu>:
# this sets the `text_input` attribute to the value
# of the `text_input` id below
text_input: text_input
...
TextInput:
id: text_input
...
Alternatively, you can access the widget via the ids
collection, and remove the text_input
attribute completely:
def load(self, path, filename):
with open(os.path.join(path, filename[0])) as stream:
# self.ids is the collection of ids for this widget rule
self.ids.text_input.text = stream.read()
self.dismiss_popup()