【发布时间】:2020-10-21 22:49:46
【问题描述】:
我正在编写一个黑色背景和白色前景的程序。
一切(条目、标签、按钮)都可以正常工作。但是当我制作checkbutton 时,我也想用黑色bg 和白色fg 来制作它。我不知道为什么,但是 bg="black" 不会将指示器背景(您单击的那个小框)更改为黑色。而且我看不到checkbutton的状态。
checkbox is on, but I can't see it
只有当我按下左键移动光标时,我才能看到它的状态:
我该如何解决这个问题?谢谢。
检查按钮代码:
self.encryptCheckButton = Checkbutton(self.root, text="Encrypt sended files?",
variable=self.encryptFile,
onvalue=1, offvalue=0,
bg="black", fg="white",
activebackground="black",
activeforeground="white")
【问题讨论】:
-
尝试设置
selectcolor='black'。另外,请阅读此answer
标签: python python-3.x tkinter