I am using a button widget and trying to put an image onto the button but the border of the button still shows up. This is similar to another complaint i had but the same fix doesnt work.
Asked
Active
Viewed 169 times
0
-
You can specify the size of the button as the size of the image. – acw1668 May 21 '20 at 23:40
-
have you tried setting the borderwidth option to zero? – Bryan Oakley May 21 '20 at 23:55
-
@acw1668 There will always be a small border around the image. – 10 Rep May 22 '20 at 00:11
1 Answers
1
As @Bryan Oakley stated in his comment, have you tried setting the borderwidth option to zero?
That is precisely what you need to do.
When creating the button:
b = Button(master, ..., borderwidth = 0)
b.pack()
Hope this helps!
Note: Look at BryanOakley's answer on highligththickness. This can also be useful at times.

10 Rep
- 2,217
- 7
- 19
- 33
-
_” Note: For a Canvas or Frame widget, use highlightthickness = 0 instead.”_ is not true. `borderwidth` and `highlightthickness` are not the same, and `Button`, `Canvas`, and `Frame` all support both. – Bryan Oakley May 22 '20 at 01:46
-
@BryanOakley I know, I just mentioned that highlightthickness exists for those widgets. Let me edit my answer. – 10 Rep May 22 '20 at 01:46
-
-
I have noticed when I use it for a Canvas widget that it removes a white border around a Canvas. In other words, it expands to fill a widget perfectly. – 10 Rep May 22 '20 at 01:50
-
Yes, it removes the highlight ring. That’s different from the border. – Bryan Oakley May 22 '20 at 02:18
-
-
Not really, your terminology is a bit confusing You say you can use `highlightthickness=0` instead of `borderwidth=0`, but that isn't guaranteed to remove the border. A canvas can have both a highlight ring _and_ a border. Using `highlightthickness` instead of `borderwidth` won't remove the border. – Bryan Oakley May 22 '20 at 04:20