12
我試圖改變我的Tkinter應用程序的背景顏色,但對於某些小部件,它會在邊緣周圍留下白色邊框。如何設置某些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部件的邊框顏色?
......如果你不希望邊境`highlightthickness`屬性都設置爲0(零)。 – 2010-12-01 11:58:54