我只能看到背景,如果我垂直拉伸窗口,则按钮可见。
我怎样才能把按钮放在图像上?
图像是1366*768
from tkinter import Tk, Label, Button, PhotoImage
root=Tk()
photo=PhotoImage(file="folder//file.gif")
w=Label(root, image=photo).pack()
btn=Button(root, text="press me").pack()
root.geometry("1366x768")
root.mainloop()
如果要在图像上放置按钮,可以使用画布而不是标签
相关问题 更多 >
编程相关推荐