[New-bugs-announce] [issue44243] tkinter button colors on Mac
Terry J. Reedy
report at bugs.python.org
Wed May 26 21:56:01 EDT 2021
New submission from Terry J. Reedy <tjreedy at udel.edu>:
Mac Mohave, 3.9 with 8.6.8 and 3.10 with 8.6.11
import tkinter as tk
r = tk.Tk()
b = tk.Button(r, text='START', fg='white', bg='red') # Or '#f00'.
On Windows, white on red button, as expected. On Mac, all white until one presses and holds mouse, and then blue background. Default black on white works OK.
This may be new since several years ago, when 2 of us worked on turtle demo, which has 3 such buttons. They all now misbehave (reported by Raymond). If someone tested on Mac, it must have worked then.
I retried with the b= line replaced with
s = ttk.Style()
s.configure('Td.TButton', foreground='white', background='red')
b = ttk.Button(r, text='START', style='Td.TButton')
with the same result. (Mark, did I get this right?)
components: Tkinter, macOS
nosy: markroseman, ned.deily, rhettinger, ronaldoussoren, taleinat, terry.reedy
title: tkinter button colors on Mac
versions: Python 3.10, Python 3.11, Python 3.9
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce