Question

Is this possible, like when you call 'hide:' it calls 'applicationWillHide:'?

My application uses a variable amount of windows, depending on the amount of available screens, so it doesn't miniaturize those NSWindow instances when 'miniaturizeAll:' is called.

Was it helpful?

Solution

NSWindowWillMiniaturizeNotification is one answer. It would be sent for each window. You could handle it with that.

You could also override: - (void)miniaturizeAll:(id)sender In an NSApplication category ( to avoid subclassing ) and call super if its ok to do so based on your conditions. Don't call super if you want to prevent it. ( but do notify users visually )

You might even set the menu item inactive when conditions match your needs, if you create a property you can bind it to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top