-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtkFrame.py
More file actions
60 lines (48 loc) · 1.61 KB
/
Copy pathtkFrame.py
File metadata and controls
60 lines (48 loc) · 1.61 KB
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
from config import Config
from Tkinter import *
class tkFrame():
def makeFrame(self):
r = 0
for d in data:
print(d)
td = 't' + d
name = Label(text=data[d])
name.grid(sticky="W", row=r, column=0, pady=10)
name.config(font=("Courier", 24))
temp = Label(text="-------C", name=d)
temp.grid(row=r, column=1, pady=10)
temp.config(font=("Courier", 34))
tm = Label(text="", name=td)
tm.grid(row=r, column=2)
#cancella la colonna
tm.grid_forget()
r = r + 1
def UpdateLabel(self, value,name, time):
tname = 't' + name
w = root.nametowidget("."+name)
wt = root.nametowidget("."+tname)
w.configure(text=value)
wt.configure(text=time)
def getLabelTime(self, name):
tname = 't' + name
r = root.nametowidget("."+tname)
return r.cget("text")
def getLabelTemperature(self, name):
r = root.nametowidget("."+name)
return r.cget("text")
def errorLabel(self, name):
r = root.nametowidget("."+name)
r.configure(text="ERROR")
def redLabel(self, name):
r = root.nametowidget("."+name)
r.configure(foreground="red")
def normalLabel(self, name):
r = root.nametowidget("."+name)
r.configure(foreground="black")
def __init__(self, r):
global data, root
root = r
con = Config()
data = con.getConfigDevice()
frame = Frame(root, name="saefy")
self.makeFrame()