1
如何动态更改Tkinter中按钮的背景颜色?如何动态更改Tkinter中按钮的颜色?
self.colorB = tk.Button(self.itemFrame, text="", bg="#234", width=10, command=self.pickColor)
我已经试过这:
self.colorB.bg = "#234"
,但它不工作.. 感谢
如何动态更改Tkinter中按钮的背景颜色?如何动态更改Tkinter中按钮的颜色?
self.colorB = tk.Button(self.itemFrame, text="", bg="#234", width=10, command=self.pickColor)
我已经试过这:
self.colorB.bg = "#234"
,但它不工作.. 感谢
使用配置
当我初始化按钮,它只能方法
self.colorB.configure(bg = "#234")