here is my code:
button1 = Image.open("start_button.png")
button1 = button1.resize((75,75), Image.ANTIALIAS)
button1 = ImageTk.PhotoImage( button1)
button1_c2 = c2.create_image(50,50, image = button1, anchor = NW)
button2 = Image.open("start_button.png")
button2 = button2.resize((75,75), Image.ANTIALIAS)
button2= ImageTk.PhotoImage(button2)
button2= Button(root, text = "", image = button2)
button2_c2 = c2.create_window(500,400, window = button2)
What im trying to do is to have a image on canvas that acts as a button.
First option imports the image, but it doesnt act as a button. So i tried the second option. It imports it on the canvas, acts as a button, but a white background got placed underneat that:
Is there a way to fix it ? By that i mean displaying an image on canvas that serves as a button and doesnt have the white background ? Thanks
Copy comment: I did the following:
buttonStart = Button(root, text = "", image = gombik, bg = "#545454", borderwidth = 0, relief = FLAT, activebackground = "#545454")
and it worked.
However ive ran into another issue..
When u press a regular button it gets "sunken" as u click it. With what ive done this doesnt happen and the button seems kinda dead.. I think ill fix it by having a function that adds another image on top of the previous one. This new image will look "sunken" and will stay this way as long as you hold the mouse click button. Then it gets removed. Any ideas ?
Ive edited borderwidth and reliefe because of this:
enter image description here