Im working on a tkinter GUI that creates labels from a dictionary. on of the labels is a "Fails" counter (theres another function that updates this value in the dictionary) id like if so when the "fails" is updated in the dictionary, it updates the fails value in the label.
heres a snippet if createing the labels from the dictionary. i cant figure out how to make it so the fails_label text is changed when the dictionary is updated
Thank you
row = 2
widgets = {}
for key in obj2create:
strEngNumber = obj2create[key][0]
strLayer = obj2create[key][1]
strFile = obj2create[key][2]
intFails = obj2create[key][3]
strJobKey = key
job_label = tk.Label(self.frame, text=key, anchor="w",
justify="center", wraplength=701,background=bg)
job_label.grid(row=row, column=0, pady=10, padx=10, ipady=3)
eng_label = tk.Label(self.frame, text=strEngNumber, anchor="w",
justify="center", wraplength=701,background=bg)
eng_label.grid(row=row, column=1, pady=10, padx=10, sticky="w")
layer_label = tk.Label(self.frame, text=strLayer, anchor="w",
justify="center", wraplength=701,background=bg)
layer_label.grid(row=row, column=2, pady=10, padx=10, sticky="w")
file_label = tk.Label(self.frame, text=strFile, anchor="w",
justify="center", wraplength=701,background=bg)
file_label.grid(row=row, column=3, pady=10, padx=10, sticky="w")
fails_label = tk.Label(self.frame, text=intFails, anchor="w",
justify="center", wraplength=701,background=bg)
fails_label.grid(row=row, column=4, pady=10, padx=10, sticky="w")