I am running into a little problem with most of my appications:
I have a main window and if a user clicks the red X the window closes, but the application stays open.
So there are 2 ways of dealing with this, none of them worked for me …
(1) quit application if you click the red x
on applicationShouldTerminateAfterLastWindowClosed_(sender) return true end applicationShouldTerminateAfterLastWindowClosed_
→ I have an app with 2 windows → a Window and a Panel if both are open, the application will quit even if I just close one window, but I would actually want it to quit ONLY when pressing close on the main window.
(2) MenuItem to bring main window back
-- action attached to menu item in IB on showWin_(sender) tell showWinMenu to setState_(true) theWindow's orderFront_(me) end showWin_
→ I would want to set the state of that MenuItem to false if the user closes the window by pressing the red (X) → where could I do that?
So one of those would be great for me.