Hi All,
I receive this error message when I try to set an input text value to a label text.
self.b5.text="You wrote " + self.username.txt
AttributeError: 'LoginScreen' object has no attribute 'b5'
This is the Python code.
Thanks in advance for your kind support.
Regards,
Giovanni
I receive this error message when I try to set an input text value to a label text.
self.b5.text="You wrote " + self.username.txt
AttributeError: 'LoginScreen' object has no attribute 'b5'
This is the Python code.
from kivy.app import App from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from kivy.uix.button import Button class LoginScreen(GridLayout): def buttonClicked(self, instance): self.b4.text="You wrote " + self.username.text def __init__(self, **kwargs): super(LoginScreen, self).__init__(**kwargs) self.cols = 1 self.add_widget(Label(text="Hello")) self.username = TextInput(multiline=True) self.add_widget(self.username) b1=(Button(text="Find")) self.add_widget(b1) b1.bind(on_press=self.buttonClicked) b4=(Label(text="Answer:")) self.add_widget(b4) b5=(Label(text='')) self.add_widget(b5) class SimpleKivy(App): def build(self): return LoginScreen() if __name__ == "__main__": SimpleKivy().run()Any help will be greatly appreciated.
Thanks in advance for your kind support.
Regards,
Giovanni