Tkinter create image function error (pyimage1 does not exist)

ぐ巨炮叔叔 提交于 2019-11-28 14:04:52

Have a try and define a master:

PhotoImage(master = canvas, width = WIDTH, height = HEIGHT)

If you do not define a master then this image uses the first Tk() which is created and if that Tk is deleted there is no image to display.

Tell me if it works, I am guessing.

Okay, I thanks for the input, people! I managed to fix it by changing the window = Tk() into window = Toplevel and replacing anchor = tkinter.NW to anchor = NW. Now it runs exactly how I intended it. On to finish the input GUI! :D

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!