Close Panel and terminate app

I’m developing a project composed by 8 modules (apps).
Instead to develop a single big project , I want to generate these 8 apps independent and “grouped” in a “launcher” with 8 buttons that launch each single app.
Most of the app has main window as panel (NSPanel).
I would like to terminate the app when I close this Panel with red button in the title bar.
How I do that?
Also, even if I enable the minimize, seems that Panels can’t be minimized. It’s true?



implement NSApplication delegate method

on applicationShouldTerminateAfterLastWindowClosed_(theApplication)

and return true

A panel can be minimized unless it’s defined as floating utility panel or HUD panel

Hi Stefan,

Thanks. OK but when I try to miniaturize the window, the event is recognized as applicationShouldTerminateAfterLastWindowClosed_ and the app quit.
How I can intercept the windowWillMiniaturize and prevent that app quit?