Burning
Burning

Reputation: 11

how to change window color on mac os

mac os: 10.10 xcode:6.1

I got a "default cocoa program" by Xcode. and I want to change the window color...after researching, I did the following code in AppDelegate.m:

NSWindow *myWindow;
NSColor *semiTransparentBlue =
[NSColor colorWithDeviceRed:0.0 green:0.0 blue:1.0 alpha:0.5];
[myWindow setBackgroundColor:semiTransparentBlue];

but window color not changed...

1: how to change the window color on mac os? 2: no NSWindow in "Default cocoa program" by Xcode, why will get a window?

thank your very much.

i tried some functions...but failed..following is the detail:

}

Upvotes: 1

Views: 2213

Answers (1)

Zakaria Wahabi
Zakaria Wahabi

Reputation: 213

in your app delegate juste type this :

self.window.backgroundColor = [NSColor whiteColor];

Upvotes: 0

Related Questions