Updating Tkinter Label with an Image

前端 未结 1 1087
耶瑟儿~
耶瑟儿~ 2020-12-21 19:12

Well I got a \"small\" problem with updating a label using Tkinter and PIL.

As soon as I press the cheese Button it should display foo2, but it just

相关标签:
1条回答
  • 2020-12-21 19:43

    Well, I think that the reason is self.show which is None when you press the button. This is because this line:

    self.show = Label(self.root, image = self.mask).pack(side = "left")
    

    should be:

    self.show = Label(self.root, image = self.mask)
    self.show.pack(side = "left")
    

    This happens, because pack, grid etc. return None.

    0 讨论(0)
提交回复
热议问题