How to set border color of certain Tkinter widgets?

前端 未结 2 1749
甜味超标
甜味超标 2020-12-29 03:23

I\'m trying to change the background color of my Tkinter app, but for certain widgets it leaves a white border around the edges.

For example, this:

f         


        
2条回答
  •  梦毁少年i
    2020-12-29 04:15

    You have to set the two highlights (with and without focus) to have a continuous color.

    from tkinter import *
    root = Tk()
    e = Entry(highlightthickness=2)
    e.config(highlightbackground = "red", highlightcolor= "red")
    e.pack()
    root.mainloop()
    

提交回复
热议问题