Mac OS: close button and execute the App (clicking on it) not works

Using the close button leave the App opens (with a dot under icon in tray bar) but when click on App Icon it does’t open the App, why ?
I’ve to close it with mouse right click and re-open …

This is the default expected behavior for macOS. Apps are independent concepts from their windows, unlike other OSes. If you wish to close your app when you close a window, add the following in the window’s close event:

Quit(0)
1 Like

Or better add the NewDocument event to the app class to open a new window, so it opens when you click again on the app.

1 Like

I’m pretty sure this is what OP is looking for. Additionally, for the inverse behavior that Anthony describes, App.AutoQuit should be set to true, and you should not call Quit from the window close event.

1 Like

I Add a Class to my app but how to add an event to that class to insert:

Application.NewDocument ()

i find only Event Definition in Add a new code item …

Click on App in the Navigator (Project item list on the left), then click Insert menu and choose Event Handler, then choose the NewDocument event.