0

I’m building a flashcard app with Tkinter in Python on macOS (macOS 26 + Python 3.13). I’m trying to make an x_button that shows only an image without any border, background, or focus ring. Here’s a minimal example:

from tkinter import *

BACKGROUND_COLOR = "#B1DDC6"

window = Tk()
window.config(bg=BACKGROUND_COLOR, pady=50, padx=50)

x_image = PhotoImage(file="images/wrong.png")

x_button = Button(
    image=x_image,
    width=100,
    height=99,
    highlightthickness=0,
    bd=0,
    borderwidth=0,
    bg=BACKGROUND_COLOR
)
x_button.grid(row=0, column=0)

window.mainloop()

On Windows/Linux this works fine, but on macOS the button always shows a bezel/border around the image (the Aqua “system button” look). Even when I set bd=0, borderwidth=0, and highlightthickness=0, the border never goes away.

What I’ve tried:

  • Setting relief="flat"
  • Setting activebackground, highlightbackground, and highlightcolor to match the background
  • Using borderwidth=0 and bd=0
  • Disabling focus with takefocus=0
  • Setting highlightthickness to 0

Question:

  • How can I make a Tkinter Button on macOS display only the image with no visible border, bezel, or glow — essentially like a flat image button?
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.