def update(self):
# Update the labels.
problem = self.problems[self.problem]
self.category.set(problem.category)
self.question.set(textwrap.fill(problem.question, TEXT_WIDTH))
self.answer.set(textwrap.fill(problem.answer, TEXT_WIDTH // 2))
self.right.set(textwrap.fill(problem.right, TEXT_WIDTH // 2))
# Update the buttons.
if self.problem == 0:
self.back['state'] = DISABLED
else:
self.back['state'] = NORMAL
if self.problem + 1 == len(self.problems):
self.next['state'] = DISABLED
else:
self.next['state'] = NORMAL
评论列表
文章目录