我不断收到以下错误: AttributeError的:“NoneType”对象有没有属性“配置”如何更改按钮的颜色与Tkinter的
# create color button
self.button = Button(self,
text = "Click Me",
command = self.color_change,
bg = "blue"
).grid(row = 2, column = 2, sticky = W)
def color_change(self):
"""Changes the button's color"""
self.button.configure(bg = "red")
优秀,这是修复!非常感谢! – 2011-04-04 20:41:45
如果您已经制作好按钮,您如何更改背景? – RhetoricalRuvim 2018-02-01 00:17:49