I've created a short and simple program just for placing a round TKinter image button on top of a label and see if it functions well. So far it works for what it's supposed to do (in this case printing "Hello World" whenever I press the button), but the one thing that bothers me is the white box that appears around the image when placed on the label.
While I did try to change the background color of the button to be the same as the label's, the white box still shows up whenever I click on the button and only disappears after letting go. I want to make sure that the white box is completely gone, but I'm not sure what changes I have to make to my code to make it possible. The following code is what I've done so far, plus a photo of the execution, open to any suggestions.
from tkinter import *
import tkinter as tk
class CustomButton:
def __init__(self):
self.root = Tk()
self.root.configure(width=470,height=550)
self.loadimage = PhotoImage(file="C://Users//UserPC//Pictures//chat2_resized.png")
self.labelBottom = Label(self.root,bg="#ABB2B9",height=80)
self.labelBottom.place(relwidth=1,rely=0.825)
self.roundButton = Button(self.labelBottom, image=self.loadimage,
command=lambda: print("Hello World"))
self.roundButton["border"] = 0
self.roundButton.pack(side="top")
self.roundButton.place(relx = 0.77,rely=0.008)
self.root.mainloop()
win = CustomButton()
win.start()
This is an example of the run. As you can see, there's a white box around the image button that I want to remove. Even if I change the background color of it, the white box still appears when I click on it.