-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exercise_5_b_TD3.py
49 lines (37 loc) · 1.31 KB
/
Exercise_5_b_TD3.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
#from tkinter import *
import tkinter as tk
root = tk.Tk()
root.geometry('1000x1000')
myCanvas = tk.Canvas(root,width=2000, height=2000, bg='white')
#myCanvas.pack()
#myCanvas.pack()
#colornew = StringVar()
def create_circle(x, y, r, canvasName,color):
x0 = x - r
y0 = y - r
x1 = x + r
y1 = y + r
canvasName.create_oval(x0, y0, x1, y1,width=10,outline=color)
#canvasName.pack()
#print(color)
#colornew.set("blue")
bBLUE = tk.Button(root, text='Draw Blue', command=lambda: create_circle(300, 200, 100, myCanvas,color="blue"))
bRED = tk.Button(root, text='Draw black', command=lambda:create_circle(500, 200, 100, myCanvas,color="black"))
bYELLOW =tk.Button(root, text='Draw red', command=lambda:create_circle(700, 200, 100, myCanvas,color="red"))
bBLACK = tk.Button(root, text='Draw yellow', command=lambda:create_circle(400, 300, 100, myCanvas,color="yellow"))
bGREEN = tk.Button(root, text='Draw Green', command=lambda:create_circle(600, 300, 100, myCanvas,color="green"))
#b1.pack()
bBLUE.pack()
bBLACK.pack()
bRED.pack()
bYELLOW.pack()
bGREEN.pack()
b1 = tk.Button(root, text='Quit', command=root.quit)
b1.pack()
myCanvas.pack()
#bRED.pack()
#bYELLOW.pack()
#bBLACK.pack()
#bGREEN.pack()
#create_circle(50, 25, 10, myCanvas)
root.mainloop()