如何更改 Tkinter 按钮颜色

时间:2021-06-17 10:44:11

标签: python tkinter

我有 3 个按钮

playbtn = Button(buttonframe,text="PLAY",command=self.playsong,width=6,height=1,font=("Comic Sans MS",16,"bold"),fg="coral4",bg="sandy brown").grid(row=0,column=0,padx=10,pady=5)

playbtn = Button(buttonframe,text="PAUSE",command=self.pausesong,width=8,height=1,font=("Comic Sans MS",16,"bold"),fg="coral4",bg="sandy brown").grid(row=0,column=1,padx=10,pady=5)

playbtn = Button(buttonframe,text="UNPAUSE",command=self.unpausesong,width=10,height=1,font=("Comic Sans MS",16,"bold"),fg="coral4",bg="sandy brown").grid(row=0,column=2,padx=10,pady=5)

playbtn = Button(buttonframe,text="STOP",command=self.stopsong,width=6,height=1,font=("Comic Sans MS",16,"bold"),fg="coral4",bg="sandy brown").grid(row=0,column=3,padx=10,pady=5)

但它们是灰色而不是沙褐色? 我该如何解决这个问题?

buttons

0 个答案:

没有答案