-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGUIWindow.py
70 lines (48 loc) · 1.66 KB
/
GUIWindow.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
63
64
65
66
67
68
69
70
import sys
import os
from tkinter import *
from tkinter import messagebox
from PIL import ImageTk, Image
def outputs(): #outputs servo values to the shell to show current arm position
print (slider_1.get(), slider_2.get(), slider_3.get(), slider_4.get())
mGui = Tk() #starts TKinter
mGui.geometry("450x800+300+300") #sets the size of the window
#Window Title
mGui.title("Robo Control v0.1")
#image
img = ImageTk.PhotoImage(Image.open("ez.png"))
panel = Label(mGui, image = img)
panel.pack(side = "top", fill = "both", expand = "no")
#Background
mGui.configure(background='orange')
#slider1
label1= Label(mGui,text="Choose your values using the sliders below").pack()
label2= Label(mGui,text="").pack()
#slider1 Rotation
label= Label(mGui,text="Rotation").pack()
slider_1 = Scale(mGui, orient=HORIZONTAL, from_=150, to=600)
slider_1.pack()
#slider2 BigArm
label2= Label(mGui,text="").pack()
label3= Label(mGui,text="Big Arm").pack()
slider_2 = Scale(mGui, orient=HORIZONTAL, from_=150, to=600)
slider_2.pack()
#slider3 Small Arm
label4= Label(mGui,text="").pack()
label5= Label(mGui,text="Small Arm").pack()
slider_3 = Scale(mGui, orient=HORIZONTAL, from_=150, to=600)
slider_3.pack()
#slider4 Claw
label6= Label(mGui,text="").pack()
label7= Label(mGui,text="Claw").pack()
slider_4 = Scale(mGui, orient=HORIZONTAL, from_=150, to=600)
slider_4.pack()
#button to shows values
label8= Label(mGui,text="").pack()
mbutton = Button(text="Show current values in shell",command = outputs, cursor="dotbox")
mbutton.pack()
#button to quit
label8= Label(mGui,text="").pack()
mbutton2 = Button(text="Exit",command = sys.exit, cursor="pirate")
mbutton2.pack()
mGui.mainloop()