-
Notifications
You must be signed in to change notification settings - Fork 0
/
pages.py
43 lines (33 loc) · 1.58 KB
/
pages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen,ScreenManager
from kivymd.uix.list import MDList, OneLineIconListItem,IconLeftWidget
class LoginScreen(Screen):
pass
class HomeScreen(Screen):
pass
class Demo2App(MDApp):
def build(self):
self.theme_cls.theme_style="Dark"
self.sm=ScreenManager()
self.sm.add_widget(LoginScreen(name="login"))
self.sm.add_widget(HomeScreen(name="home"))
screen=Builder.load_file("helper_file.kv")
return screen
def do_login(self):
self.root.current = "home"
for i in range(20):
st_name = "student "
list_item = OneLineIconListItem(text=f"student {str(i)}")
list_item.add_widget(IconLeftWidget(icon="alpha-a-box"))
logging.info("this is my App:", self)
logging.info("this is my ScreenManager:", self.sm)
logging.info("this is my global app visual widget (which is equal to ScreenManager here):", self.root)
logging.info("this is the ScreenManager's dictionnary containing the widgets referenced with their id:", self.root.ids)
logging.info("this is the current Screen:",self.root.current_screen)
logging.info("this is current Screen dictionnary containing the widgets referenced with their id:", self.root.current_screen.ids)
logging.info("this is the actual MDList", self.root.current_screen.ids["users_lst"])
self.root.current_screen.ids["users_lst"].add_widget(list_item)
Demo2App().run()
"""