Reputation: 1819
Hey, I was wondering if it's possible to make a mac os x app to hide specific windows that the user selects. I know how to make a button hide all windows and unhide all windows but I would like to know how to hide specific windows.
Thanks!
Upvotes: 2
Views: 1404
Reputation: 61228
Presumably somewhere you have references to your application's windows. From there you simply tell the window to -orderOut:
.
Even if you aren't keeping track of your windows yourself, you can get a list of your application's windows by asking [NSApp windows]
.
In a document-based app, you can get all the windows by their owning documents (there can be many windows per individual document) by asking: [[NSDocumentController sharedDocumentController] documents]
then asking each for its -windowControllers
, then asking each window controller for its -window
.
Upvotes: 2