from tkinter import *
#Making the frame_____________
class Window(Frame):
def __init__(self, master = None):
Frame.__init__(self,master)
self.master = master
self.init_window()
#_____________________________
#Making the actual window
def init_window(self):
self.master.title("Ethics and similar topics quiz")#Title along the top of the window
self.pack(fill=BOTH, expand=1)
StartButton = Button(self, text="Start Quiz", fg = "Purple", command=self.showtxt)
StartButton.config(height = 4 , width = 25)
StartButton.place(x=815, y=1)#Positions it
def showtxt(self):
text1 = Label(self, text= "What is the meaning of the word 'Ethical'?")
text1.pack
有我的代码,出于某种原因,当我在开始按钮之外添加任何其他内容时,它不会显示在我的窗口上。有什么问题?