-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsandbox.py
49 lines (37 loc) · 1.4 KB
/
sandbox.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 Canvas, PhotoImage, mainloop
import tkinter as tk
import matplotlib
from tkinter import ttk
def make_sphere_object_widget(root, spheres):
# icon = tk.PhotoImage('./icons/sphere.png')
frame = tk.Frame(root,)
for index, sphere in enumerate(spheres):
button = tk.Button(frame,text='⦾',bg=matplotlib.colors.to_hex([
sphere.color.x,
sphere.color.y,
sphere.color.z,
]
))
# Coordinates
coordinat_x = tk.Entry(frame, width=4, foreground='white', background='#483D41')
coordinat_x.insert(0,sphere.center.x)
coordinat_y = tk.Entry(frame,width=4, foreground='white', background='#483D41')
coordinat_y.insert(0,sphere.center.y)
coordinat_z = tk.Entry(frame,width=4, foreground='white', background='#483D41')
coordinat_z.insert(0,sphere.center.z)
button.grid(row=index,column=0)
coordinat_x.grid(row=index,column=1)
coordinat_y.grid(row=index,column=2)
coordinat_z.grid(row=index,column=3)
# Color
# Coordinates
color_x = tk.Entry(frame, width=3,foreground='white',background='#797979')
color_x.insert(0,sphere.color.x)
color_y = tk.Entry(frame,width=3,foreground='white',background='#797979')
color_y.insert(0,sphere.color.y)
color_z = tk.Entry(frame,width=3,foreground='white',background='#797979')
color_z.insert(0,sphere.color.z)
color_x.grid(row=index,column=4)
color_y.grid(row=index,column=5)
color_z.grid(row=index,column=6)
return frame