Guest User

Untitled

a guest
Nov 1st, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. from kivy.app import App
  2. from kivy.lang import Builder
  3. from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
  4. from kivy.uix.boxlayout import BoxLayout
  5. from kivy.uix.gridlayout import GridLayout
  6. from kivy.properties import ObjectProperty, StringProperty
  7. import win32api
  8.  
  9. class MainScreen(Screen):
  10. pass
  11.  
  12. class AnotherScreen1(Screen):
  13. def check_validation(self,instance,username,password):
  14. if (username == "") or (password == ""):
  15. print("Blank spaces are not allowed")
  16. win32api.MessageBox(0, 'Username and/or Password cannot be Blank', 'Warning')
  17. elif username == password:
  18. instance.current = "other2"
  19. else:
  20. print("username and password don't match")
  21. win32api.MessageBox(0, 'Invalid Username and/or Password', 'Warning')
  22. instance.current = "other1"
  23.  
  24. class AnotherScreen2(Screen):
  25. def screen_transition(self,instance,btn):
  26. if(btn == 'BACK'):
  27. instance.current = "other1"
  28. elif(btn == 'LOGOUT'):
  29. instance.current = 'main'
  30.  
  31. class ScreenManagement(ScreenManager):
  32. pass
  33.  
  34. class MyBox(BoxLayout):
  35. pass
  36.  
  37. buildbox = Builder.load_file("main_box.kv")
  38.  
  39. class simplekivy3(App):
  40. def build(self):
  41. return buildbox
  42.  
  43. if __name__ == '__main__':
  44. simplekivy3().run()
Add Comment
Please, Sign In to add comment