Ticket UUID: | 9fcef965a54fea446d1cb99324a56047a343970a | |||
Title: | macOS aqua: certain menu entries' text color always black | |||
Type: | Bug | Version: | 8.6.8 | |
Submitter: | chrstphrchvz | Created on: | 2018-08-01 16:47:10 | |
Subsystem: | 11. Aqua Menus | Assigned To: | nobody | |
Priority: | 5 Medium | Severity: | Important | |
Status: | Closed | Last Modified: | 2019-03-01 12:17:49 | |
Resolution: | Invalid | Closed By: | chrstphrchvz | |
Closed on: | 2019-03-01 12:17:49 | |||
Description: |
Sometimes the text color for entries in menus and menubuttons is always black without The impairments to usability are that the black text of a highlighted entry does not contrast well with the blue region; and that if the dark menu bar is enabled, then unhighlighted entries are completely unreadable. I found this while using Tcl::pTk Perl module; the issue is reproducible using its widgetTclpTk demo program (from the menus.pl and menus2.pl demos) (see https://rt.cpan.org/Public/Bug/Display.html?id=125049): I also observed this in Gitk, which is a pure Tcl/Tk program: I haven't come up with a minimal test case that exhibits this issue, so I might not have ruled out that this isn't caused by whatever is using Tcl/Tk rather than by Tcl/Tk itself. I don't observe this issue in Tcl/Tk's widget demo program (menu and menubu). I have observed this both with the included Tcl/Tk 8.5.9 in recent macOS as well as Tcl/Tk 8.6.8 (from MacPorts' I'm not familiar with the Tk source, but I would appreciate any suggestions on where to look. Feel free to update this description with more precise verbiage. | |||
User Comments: |
chrstphrchvz added on 2019-03-01 12:17:49:
I finally found the cause (though not yet a solution) for this issue in Tcl::pTk. It must not have occurred to me earlier to heed the documentation for If this option is specified as an empty string (the default), then the (-background/-foreground/etc.) option for the overall menu is used. So once I checked I'll go ahead and close this ticket. kevin_walzer added on 2018-08-13 11:44:17: When you do not configure the menu entries, cget -foreground won't return anything, because the native coloring is used; Tk does not know about this nor register it. The behavior you are seeing is not present in the Tcl/Tk versions of these demos--as I expect. Therefore, I can only conclude the issue is somewhere in your code, which I assume is re-implementing these demos in Perl. I've done some work with Perl's Tkx module, but not with Perl-Tk directly, nor with the wrapper library you are working with, so I'm not sure where to point you. Your Tcl::pTk seems a great project, bridging all that legacy Perl-Tk code into the modern Tcl/Tk world. Thanks for that! chrstphrchvz added on 2018-08-13 10:52:17:
Some more observations I've made: if I have not manually set a
-activeforeground and -activebackground have no visble effect on aqua.
For the following screenshots, "Print hello" is a correctly behaving entry, and "See current values" is an incorrectly behaving entry.
Screenshot with
Screenshot with kevin_walzer added on 2018-08-13 02:12:32: The menus on macOS always highlight when selected natively; that is the default if their appearance is not configured at the script level in Tk. The screenshots you show suggest to me that there is some configuration going on somewhere in your script. There is no need to set font, size, color, etc. anywhere in Tk menus on macOS unless you have a specific reason. |