DEV Community

Momodu Arimiyahu
Momodu Arimiyahu

Posted on

'ConnectPage' had no attribute 'add' Error in Python and Kivy

Dear All,
Good day, when i try running this program the error message am getting is
//'ConnectPage' had no attribute 'add'

My code can be found bellow

import kivy
import os
os.environ ['KIVY_GL_BACKEND'] = 'angle_sdl2'

from kivy import Config
Config.set('graphics', 'multisamples', '0')

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
kivy.require("1.10.1")

class ConnectPage(GridLayout):
def init(self, kwargs):
super().init(
kwargs)
self.cols = 2
self.add.widget(Label(text="Username"))
self.Username = TextInput(multiline=False)
self.add_widget(self.Username)

    self.add.widget(Label(text="Password"))
    self.Password = TextInput(multiline=False)
    self.add_widget(self.Password)

class ADU360(App):
def build(self):
return ConnectPage()

if name == "main":
ADU360().run()

I really appreciate you guys help. Thank you in advance.

Top comments (0)