Objective-C/Cocoa noob here. I'd like to make the window color in a little Mac app I'm making white, instead of the default light grey color. What's the proper way to do this?
3
votes
4 Answers
5
votes
From the AppDelegate you can simply invoke the window
property
self.window.backgroundColor = [NSColor whiteColor];
otherwise from any point of you application you can call
[[NSApplication sharedApplication] keyWindow].backgroundColor = [NSColor whiteColor];
keyWindow
is the currently "on top" window, which is probably the only one if the application is simple. For more complicated scenarios where you need a different window you can use
[[NSApplication sharedApplication] windows]
which will return an array of all the windows owned by the application.
1
votes
0
votes