Folks;
It seems to me that NSTextViews are an ambivelent participant in DarkMode - view Apple's own Mail and TextEdit as examples.
Apple docs even mention that you might want to use a 'normal' textview for presenting long runs of text (e.g. TextEdit does this)
I'm trying to give the user a choice. Let them decide how a mainTextView in my macOS application displays text.
The gist of this can be summed up as:
if (@available(macOS 10.14, *)) {
if ([[NSAppearance currentAppearance].name isEqualTo:NSAppearanceNameDarkAqua]) {
if (tag==1){
//use whiteText on black
[self.mainTextView setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]];
} else if (tag==2) {
//use blackText on white
[self.mainTextView setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
}
}
}
This does not work.
I've also tried implementing the appearance change all the way up the superview chain. That does not work either.
Anyone have any tips on how to go about implementing this?
Thank you for any input.
Steve