from tkinter import *
THEME_COLOR = "#375362"
class QuizInterface():
def __int__(self):
# super().__int__()
self.window = Tk()
self.window.title('Quizzler')
self.window.config(pady=20,padx=20,bg=THEME_COLOR)
self.score_label = Label(text="Score: 0",fg="white",bg=THEME_COLOR)
self.score_label.grid(row=0,column=1)
self.canvas = Canvas(width=300,height=250,bg="white")
self.question_text = self.canvas.create_text(text="Some Question Text",fill=THEME_COLOR)
# self.question_text = self.canvas.create_text(150,125,text="Some Question Text", fill=THEME_COLOR)
self.canvas.grid(row=1,column=0,columnspan=2)
self.window.mainloop()
我试着在这里和YouTube上搜索解决方案,但我没有找到。
1条答案
按热度按时间2cmtqfgy1#
您只是创建了一个类,但实际上并没有使用该类创建一个对象。你必须做一些事情
最后,调用init函数