new purge of radios, first step for coloring correct element

This commit is contained in:
Martin Putzlocher 2022-01-17 07:56:33 +00:00
parent d48361e23d
commit 23270abd97

View File

@ -4,7 +4,7 @@ from tkinter import font as tkfont
DEBUG = True
# Acces to Controller
# Access to Controller
from neuesquiz_controller import *
@ -48,7 +48,7 @@ class Application(tk.Frame):
# Radiobuttons
self.radios=list()
self.radios = list()
selected_elements = self.controller.current_selection
for count, (el_key, el_value) in enumerate(selected_elements.items()):
r = tk.Radiobutton(self.lf_a, text=el_value,
@ -106,7 +106,12 @@ class Application(tk.Frame):
# TODO: coloring of correct answer in green
def mark_correct_answer(self):
pass
# Was auf grün setzen? -> Element finden
for element in self.radios:
print("Element finden")
print(element.cget('value'))
# Ausführen: auf grün setzen.
element['bg'] = "green"
# TODO: coloring of selected answer in red if wrong
def mark_answer_incorrect(self):
@ -146,8 +151,13 @@ class Application(tk.Frame):
def purge_radios(self):
for r in self.radios:
r.grid_forget()
r.destroy()
del(self.radios)
self.radios = list()
# TODO: reset of all elements
def reset(self):
pass