Reputation:
I am using the following code on my NSWindow so that all my buttons, pop ups, etc. are in a dark mode tint:
[self.window setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
But I want to set a custom window background color instead of the black color which is set as default for the Vibrant Dark Appearance. Calling this line without the appearance works otherwise fails to set:
self.window.backgroundColor = [NSColor colorWithPatternImage:[NSImage imageNamed:@"backgroundColor"]];
Any ideas?
Upvotes: 0
Views: 1722
Reputation: 2046
Just add a view with a background color and use It as your window's background.
Take a look at this sample app.
Upvotes: 3