-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.py
61 lines (37 loc) · 1.1 KB
/
Main.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
56
57
58
59
60
61
from tkinter import *
from editor.AppCanvas import AppCanvas
from editor.Editor import Editor, EditorThread
from interpreter.Interpreter import Interpreter
window = Tk()
window.wm_title('Kbra Project')
window.resizable(0, 0)
def keyDown(_):
# editor_thread.isPressing = True
pass
def keyUp(_):
# editor_thread.isPressing = False
editor.color()
pass
window.bind('<KeyPress>', keyDown)
window.bind('<KeyRelease>', keyUp)
def exit_app():
editor_thread.request_stop()
window.after(200, window.destroy)
pass
window.protocol('WM_DELETE_WINDOW', exit_app)
frame = Frame(window)
button = Button(window, text='Play', borderwidth=2, highlightthickness=5)
editor = Editor(frame)
editor_thread = EditorThread(editor.editor)
canvas = AppCanvas(frame)
def run(_):
interpreter = Interpreter(canvas.library)
interpreter.start(editor.get_text())
pass
button.bind('<Button-1>', run)
button.pack()
canvas.canvas.pack(side=RIGHT)
editor.edit.pack(side=RIGHT)
frame.pack()
# editor_thread.start()
window.mainloop()