Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quit app when window is closed #40

Closed
schuettla opened this issue Jan 21, 2016 · 4 comments
Closed

Quit app when window is closed #40

schuettla opened this issue Jan 21, 2016 · 4 comments
Milestone

Comments

@schuettla
Copy link

An app I built with Webshell just got rejected from the app store with the following statement regarding the default behavior when the main window gets closed:

We have found that when the user closes the main application window there is no menu item to
re-open it. The app should implement a Window menu that lists the main window so it can be
reopened, or provide similar functionality in another menu item. OS X Human Interface Guidelines,
state that "The menu bar [a]lways contains [a] Window menu".

Alternatively, if the application is a single-window app, it might be appropriate to save data and quit the > app when the main window is closed. ''

As it is an single-window app it would be good to add the behavior as stated in the HIGuidlines.

@djyde djyde added this to the v0.1.11 milestone Jan 22, 2016
@djyde
Copy link
Owner

djyde commented Jan 22, 2016

Feeling sorry for my ignoring.

But there is a Window item on menubar. Which version did you use?

image

@schuettla
Copy link
Author

I am using the master branch.
Yes, there is the Window menu but the behavior is not HIG compliant. There are 2 options:

  1. When you close the main window the window menu provides a functionality to reopen the main window again.
  2. When you close the main window the whole application closes.

@0xWDG
Copy link
Collaborator

0xWDG commented Jan 26, 2016

override func viewDidDisappear() {
    exit(0);
}

is that a good option (uses option 2)

@0xWDG 0xWDG closed this as completed in 5af337b Jan 26, 2016
@0xWDG
Copy link
Collaborator

0xWDG commented Jan 26, 2016

Never mind. fix is there

dguo added a commit to dguo/donate-and-smile-safari that referenced this issue Dec 19, 2018
Our app was rejected by App Store review because:

"The user interface of your app is not consistent with the macOS Human
Interface Guidelines.

Specifically, we found that when the user closes the main application
window there is no menu item to re-open it."

A suggested option for a single-window app is to "save data and quit the
app when the main window is closed," and that's what we are doing.

Thanks to djyde/WebShell#40 for pointing me to
the appropriate AppKit method:
https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428381-applicationshouldterminateafterl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants