forked from harshv834/learning_git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tkinter_gui.py
77 lines (75 loc) · 2.78 KB
/
tkinter_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from Tkinter import *
window = Tk()
label = Label(window, bd=5, font=("Helvetica", 16), fg="blue", anchor=N, text="AUV IITK")
label.pack()
ca = Canvas(window, height=50)
ca.pack()
def coma():
print w1.get()
w1.set(0)
main = PanedWindow()
main.pack()
m1 = PanedWindow(main, orient=VERTICAL)
main.add(m1)
w1 = Scale(m1, length=150, troughcolor="orange", highlightbackground="grey", label="PWM", fg="darkviolet", from_=0, to=255, orient=HORIZONTAL, activebackground="lightgreen")
forward = Button(m1, text="forward", height=2)
l1 = Label(m1, fg="green", font=("Helvetica", 12), text="front")
backward = Button(m1, text="backward", height=2)
stop_front = Button(m1, text="stop", fg="yellow", bg="red")
m1.add(l1)
m1.add(w1)
m1.add(forward)
m1.add(backward)
m1.add(stop_front)
ca = Canvas(main, width=50, height=100)
main.add(ca)
m2 = PanedWindow(main, orient=VERTICAL)
main.add(m2)
w2 = Scale(m2, length=150, troughcolor="orange", highlightbackground="grey", label="PWM", fg="darkviolet", from_=0, to=255, orient=HORIZONTAL, activebackground="lightgreen")
l2 = Label(m2, fg="green", font=("Helvetica", 12), text="vertical")
up = Button(m2, text="up", height=2)
down = Button(m2, text="down", height=2)
stop_vertical = Button(m2, fg="yellow", bg="red", text="Stop")
m2.add(l2)
m2.add(w2)
m2.add(up)
m2.add(down)
m2.add(stop_vertical)
ca = Canvas(main, width=50, height=100)
main.add(ca)
m3 = PanedWindow(main, orient=VERTICAL)
main.add(m3)
w3 = Scale(m3, length=150, troughcolor="darkmagenta", highlightbackground="grey", label="PWM", fg="darkviolet", from_=0, to=255, orient=HORIZONTAL, activebackground="lightgreen")
l3 = Label(m3, fg="green", font=("Helvetica", 12), text="sway")
left = Button(m3, text="Sway left", height=2)
right = Button(m3, text="Sway right", height=2,font=("Helvetica", 16),)
stop_sway = Button(m3, fg="yellow", bg="red", text="stop")
m3.add(l3)
m3.add(w3)
m3.add(left)
m3.add(right)
m3.add(stop_sway)
ca = Canvas(main, width=50, height=100)
main.add(ca)
m4 = PanedWindow(main, orient=VERTICAL)
main.add(m4)
w4 = Scale(m4, length=150, troughcolor="orange", highlightbackground="grey", label="PWM", fg="darkviolet", from_=0, to=255, orient=HORIZONTAL, activebackground="lightgreen")
l4 = Label(m4, fg="green", font=("Helvetica", 12), text="turn")
clockwiseSway = Button(m4, text="clockwise (sway)")
anticlockwiseSway = Button(m4, text="anticlockwise (sway)")
clockwiseFront = Button(m4, text="clockwise (front)")
anticlockwiseFront = Button(m4, text="anticlockwise (front)")
stop_turn = Button(m4, bg="red", fg="yellow", text="stop", command=coma)
m4.add(l4)
m4.add(w4)
m4.add(clockwiseSway)
m4.add(anticlockwiseSway)
m4.add(clockwiseFront)
m4.add(anticlockwiseFront)
m4.add(stop_turn)
# Radiobutton(window, text="kaka", value=2).pack()
# button.pack(side=LEFT)
# w.pack()
p = w1.get()
# window.lower()
window.mainloop()