How to add border to a button in python for Tkinter?
12,746
as per http://effbot.org/tkinterbook/button.htm:
borderwidth= variable
The width of the button border. The default is platform specific, but is usually 1 or 2 pixels. (borderWidth/BorderWidth)
not to be confused with:
highlightthickness= variable
The width of the highlight border. The default is system specific (usually one or two pixels). (highlightThickness/HighlightThickness)
Related videos on Youtube
Author by
Ana_wtk17
Updated on June 04, 2022Comments
-
Ana_wtk17 almost 2 years
b1 = Button(tk, text=" ", font=("Consolas 30 bold"), height = 1, width = 4,bg = "white", command=lambda:checker(b1))
What piece of code to I add to this to add a border to the button, as in making it thicker?
-
glls almost 8 yearsplease consider researching a bit more prior to posting a question.
-
shevy almost 3 yearsIn regards to glls's comment above: SO is useful as a resource for people to find answers to questions, even years later (I just found it because I had PRECISELY the same use case and question). With your statement you have not provided anything useful towards Rory Daulton, as well as other people who may come here to try to find answers. Please refrain from telling other people what to do in this regard. Thank you.
-
-
Russell Smith almost 8 years
highlightthickness
is not the same as a border, it's more like a ring around the button. A border is controlled withborderwidth
andrelief
.