我有以下代码,似乎没有" self"被添加到小部件实例。如果我不使用自我,我会遇到问题吗?
class Appy:
def __init__(self, master):
self.drawBoard()
def drawBoard(self):
pane_1 = ttk.PanedWindow(master, orient='horizontal')
pane_1.pack(padx=20, pady=10, fill='both', expand=True)
photo_frame = ttk.Frame()
content_frame = ttk.Frame()
pane_1.add(photo_frame)
pane_1.add(content_frame)
image_label = ttk.Label(photo_frame)
image_label.pack(anchor='center', fill='both', expand=True)
....
if __name__ == '__main__':
master = tkinter.Tk()
Appy(master)
master.geometry('1250x750+200+50')
master.mainloop()