Tk Source Code

View Ticket
Login
Ticket UUID: 46274a117823fd65c6d98d38465b43165d0c4680
Title: Button background color is ignored on macOS
Type: Bug Version: 8.6.11
Submitter: taleinat Created on: 2021-05-27 09:10:41
Subsystem: 03. [*button] and [label] Assigned To: kevin_walzer
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2021-05-27 12:33:47
Resolution: Invalid Closed By: kevin_walzer
    Closed on: 2021-05-27 12:33:47
Description:
With the following simple example, the configured background button is ignored:

$ wish
% button .b -text START -bg red -fg white
.b
% pack .b

This was originally discovered by Python developers, see related bug on the Python issue tracker:
https://bugs.python.org/issue44243
User Comments: kevin_walzer added on 2021-05-27 12:33:47:
Because Tk on the Mac uses API's to draw buttons, some configuration options are set by the OS and not by Tk. This is documented in the button man page: "On Aqua/Mac OS X, some configuration options are ignored for the purpose of drawing of the widget because they would otherwise conflict with platform guidelines. The configure and cget subcommands can still manipulate the values, but do not cause any variation to the look of the widget. The options affected notably include -background and -relief." Closing this ticket as not a bug.