-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.py
65 lines (52 loc) · 1.38 KB
/
gui.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
62
import PySimpleGUI
import servo
from servo import servo_left
def mov_gui():
x = 0
y = 0
file_line_of_column = [
[
PySimpleGUI.Button("▲"),
]
]
second_line_of_column = [
[
PySimpleGUI.Button("◄"),
PySimpleGUI.Button(" "),
PySimpleGUI.Button("►")
]
]
third_line_of_column = [
[
PySimpleGUI.Button("▼"),
]
]
option_line = [
[
PySimpleGUI.Button("Exit"),
]
]
layout = [
[PySimpleGUI.Column(file_line_of_column, justification='center')],
[PySimpleGUI.Column(second_line_of_column, justification='center')],
[PySimpleGUI.Column(third_line_of_column, justification='center')],
[PySimpleGUI.Column(option_line, justification='center')]
]
window = PySimpleGUI.Window("Image Viewer", layout)
while True:
event, values = window.read()
if event == "Exit" or event == PySimpleGUI.WIN_CLOSED:
break
if event == "▲":
y = y + 1
print('x',x,'y',y)
if event == "▼":
y = y - 1
print('x',x,'y',y)
if event == "►":
x = x + 1
print('x',x,'y',y)
if event == "◄":
x = x - 1
servo.servo_left()
print('x',x,'y',y)