Reputation: 837
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
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