-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphic_library.py
45 lines (37 loc) · 1.19 KB
/
graphic_library.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
import kivy
kivy.require('1.10.0') # replace with your current kivy version !
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.stacklayout import StackLayout
from kivy.uix.pagelayout import PageLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.graphics import Canvas
from kivy.graphics import Rectangle
class MyWidget(Widget):
pass
class CustomWidget(Widget):
pass
class MyApp(App):
def build(self):
#self.load_kv('MyApp.kv')
self.title = "Graphic Test Framework"
widget = MyWidget()
widget.add_widget(Label(text="prueba"))
myCanvas = Canvas()
myCanvas.add(Rectangle(size=(350, 1), pos=(0, 500)))
widget.canvas = myCanvas
widget.add_widget(Button(text="Boton", pos=(100, 500)))
return widget
return MyWidget()
return PageLayout()
return StackLayout()
return BoxLayout()
return GridLayout()
return FloatLayout()
return CustomWidget()
if __name__ == '__main__':
MyApp().run()