我想改变我的Tkinter应用程序的背景颜色,但对于某些小部件,它会在边缘留下白色边框。
例如,这样做:
from tkinter import *
COLOR = "black"
root = Tk()
root.config(bg=COLOR)
button = Button(text="button", bg=COLOR)
button.pack(padx=5, pady=5)
entry = Entry(bg=COLOR, fg='white')
entry.pack(padx=5, pady=5)
text = Text(bg=COLOR, fg='white')
text.pack(padx=5, pady=5)
root.mainloop()
我该如何设置特定 Tkinter widget 的边框颜色?
highlightbackground
。 - TheLizzardbg=...
的框架中,然后在小部件上使用.pack(padx=..., pady=...)
。 - TheLizzard