haseo98
haseo98

Reputation: 837

Change the background color of an entire NSWindow class

I'm currently setting menu items to change the colours of "individual" windows in my Mac application.

[_window setBackgroundColor : [NSColor redColor]];

Is there a way to make that menu item change in all my windows, in contrast to just "_window"?

Upvotes: 0

Views: 571

Answers (1)

Kevin Grant
Kevin Grant

Reputation: 5431

You could use the windows method of NSApplication.

This would probably do it:

[[NSApp windows] makeObjectsPerformSelector:@selector(setBackgroundColor:) withObject:[NSColor redColor]];

(Or you might want a for-loop to examine each window more carefully.)

Upvotes: 1

Related Questions