Advertisement
Guest User

loginpage2.py

a guest
Aug 10th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | None | 0 0
  1. import kivy
  2. from kivy.app import App
  3. from kivy.uix.label import Label
  4. from kivy.uix.button import Button
  5. from kivy.uix.widget import Widget
  6. from kivy.uix.textinput import TextInput
  7. from kivy.uix.gridlayout import GridLayout
  8. from kivy.uix.floatlayout import FloatLayout
  9. from kivy.uix.boxlayout import BoxLayout
  10. from kivy.lang import Builder
  11. from kivy.core.window import Window
  12.  
  13.  
  14. class loginscreen(GridLayout):
  15.     def __init__(self,**kwargs):
  16.         super(loginscreen,self).__init__(**kwargs)
  17.         self.cols=2
  18.         self.label='Username'
  19.         self.color=1,0,0,1
  20.  
  21.         for i in range(5):
  22.    
  23.             self.password=False
  24.             if i is 1:
  25.                 self.label='Password'
  26.                 self.password=True
  27.             elif i is 2:
  28.                 self.label='Email'
  29.             elif i is 3:
  30.                 self.label='Email Password'
  31.                 self.password=True
  32.             elif i is 4:
  33.                 self.label='Address'
  34.             self.add_widget(Button(text=self.label,color=self.color))
  35.             self.username=TextInput(multiline=False, password=self.password)
  36.             self.add_widget(self.username)
  37.    
  38.            
  39. class app(App):
  40.     def build(self):
  41.         Window.clearcolor=(1,1,1,1)
  42.         return loginscreen()
  43.        
  44. if __name__=='__main__':
  45.     app().run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement