【发布时间】:2020-05-02 03:12:02
【问题描述】:
topper = Toplevel()
topper.title("2nd Window")
topper.state('zoomed')
my_img = ImageTk.PhotoImage(Image.open("diamond.png"))
my_label = Label(topper, image=my_img, height = 100 , width = 100)
F21 = Frame(topper, borderwidth=83, bg="blue", relief=SUNKEN)
button1 = Button(topper, text="class", command=topper.destroy)
button1.pack()
my_label.pack()
我正在运行代码,我没有收到任何错误,按钮也可以正常工作,但我无法在窗口中看到图片。
【问题讨论】:
-
代码在函数内部吗?
标签: python python-3.x tkinter