方法
configure
需要应用于实例,而不是基类。
让它在
Options
bgLight
bgDark
作为类的方法:
def bgLight(self):
self.configure(bg="#fff")
#self.configure(fg="#000") no foreground on Frame
def bgDark(self):
self.configure(bg="#000")
#self.configure(fg="#fff")
Radiobutton
命令:
radio = tk.Radiobutton(self, text="One", value=1, command=self.bgLight)
radio = tk.Radiobutton(self, text="Two", value=0, command=self.bgDark)
background
和
foreground
在
controler
配置
控制器
.
tkinter.Frame
.
,方法可以是:
def bgLight(self):
self.controller.background = "#fff"
self.controller.foreground = "#000"
def bgDark(self):
self.controller.background = "#000"
self.controller.foreground = "#fff"