new purge of radios, first step for coloring correct element
This commit is contained in:
parent
d48361e23d
commit
23270abd97
@ -4,7 +4,7 @@ from tkinter import font as tkfont
|
|||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
# Acces to Controller
|
# Access to Controller
|
||||||
from neuesquiz_controller import *
|
from neuesquiz_controller import *
|
||||||
|
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ class Application(tk.Frame):
|
|||||||
|
|
||||||
# Radiobuttons
|
# Radiobuttons
|
||||||
|
|
||||||
self.radios=list()
|
self.radios = list()
|
||||||
selected_elements = self.controller.current_selection
|
selected_elements = self.controller.current_selection
|
||||||
for count, (el_key, el_value) in enumerate(selected_elements.items()):
|
for count, (el_key, el_value) in enumerate(selected_elements.items()):
|
||||||
r = tk.Radiobutton(self.lf_a, text=el_value,
|
r = tk.Radiobutton(self.lf_a, text=el_value,
|
||||||
@ -106,7 +106,12 @@ class Application(tk.Frame):
|
|||||||
|
|
||||||
# TODO: coloring of correct answer in green
|
# TODO: coloring of correct answer in green
|
||||||
def mark_correct_answer(self):
|
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
|
# TODO: coloring of selected answer in red if wrong
|
||||||
def mark_answer_incorrect(self):
|
def mark_answer_incorrect(self):
|
||||||
@ -146,8 +151,13 @@ class Application(tk.Frame):
|
|||||||
|
|
||||||
def purge_radios(self):
|
def purge_radios(self):
|
||||||
for r in self.radios:
|
for r in self.radios:
|
||||||
|
r.grid_forget()
|
||||||
r.destroy()
|
r.destroy()
|
||||||
|
|
||||||
|
del(self.radios)
|
||||||
|
self.radios = list()
|
||||||
|
|
||||||
|
|
||||||
# TODO: reset of all elements
|
# TODO: reset of all elements
|
||||||
def reset(self):
|
def reset(self):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user