-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
51 lines (36 loc) · 857 Bytes
/
test.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
import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.uix.popup import Popup
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_string('''
<PaintWindow>:
orientation: 'vertical'
<CPopup>:
title: 'Pick a Color'
size_hint: 1.0, 0.9
id: cpopup
BoxLayout:
orientation: 'vertical'
ColorPicker:
size_hint: 1.0, 1.0
Button:
text: 'OK'
size_hint: 1.0, 0.2
on_press: root.dismiss()
''')
class PaintWindow(BoxLayout):
pass
class CPopup(Popup):
def on_press_dismiss(self, *args):
self.dismiss()
return False
class PixPaint(App):
def build(self):
pw = PaintWindow()
popup = CPopup()
popup.open()
return pw
if __name__ == '__main__':
PixPaint().run()