Using tkmacosx 1.0.5 I have two buttons. One shows an image. When clicking on the second one, it should show the same image. The image does appear but is shifted to the upper left corner on the second button and therefore becomes partially invisible. How can I avoid that behaviour?
Same behaviour when using place() or pack() instead of grid(). The image is shown correctly when using tkinter instead. However other things don't work with tkinter on macOS, which is why I wanted to use tkmacosx.
How can I use
import tkinter as tk
from tkmacosx import Button
root = tk.Tk()
my_img = tk.PhotoImage(file='img.png')
def pressed(but):
but.config(image=my_img)
b_1 = Button(root, bg='white', width=600, height=500)
b_2 = Button(root, bg='white', width=600, height=500)
b_1.config(command=lambda b=b_1: pressed(b))
b_2.config(command=lambda b=b_2: pressed(b))
b_1.config(image=my_img)
b_1.grid(column=1, row=1)
b_2.grid(column=2, row=1)
root.mainloop()