如何使用tkinter更改按钮颜色
发布于 2021-01-29 18:22:09
我不断收到以下错误:AttributeError:’NoneType’对象没有属性’configure’
# 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")
关注者
0
被浏览
168
1 个回答