forked from Priyanshu-server/kivyAndKivyMD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
label and icon.py
55 lines (41 loc) · 1011 Bytes
/
label and icon.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
44
45
46
47
48
49
50
51
52
53
54
55
from kivymd.app import MDApp
from kivy.uix.screenmanager import Screen,ScreenManager
from kivy.lang import Builder
#Builder String
helper_string = '''
ScreenManager:
Hello:
Bye:
<Hello>:
name: 'hello'
MDLabel:
text: 'Hello!! world'
halign: 'center'
theme_text_color: 'Custom'
text_color : 148/255,0,211/255,1
font_style : 'H1'
MDIcon:
icon : 'android'
halign: 'center'
font_size: 300
theme_text_color: 'Custom'
text_color: 0,0,1,1
<Bye>
name: 'bye'
MDLabel:
text: 'Good Bye'
'''
class Hello(Screen):
pass
class Bye(Screen):
pass
sm = ScreenManager()
sm.add_widget(Hello(name = 'hello'))
sm.add_widget(Bye(name='bye'))
class DemoApp(MDApp):
def build(self):
screen = Screen()
help_str = Builder.load_string(helper_string)
screen.add_widget(help_str)
return screen
DemoApp().run()