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

Enable closing ⓧ button for text window #183

Closed
ad-si opened this issue Nov 10, 2020 · 9 comments
Closed

Enable closing ⓧ button for text window #183

ad-si opened this issue Nov 10, 2020 · 9 comments

Comments

@ad-si
Copy link

ad-si commented Nov 10, 2020

Is there a way to enable the red window closing button for text windows and web views? It's quite unintuitive that you have to click a separate "Quit" button.

@chris1111
Copy link

chris1111 commented Dec 17, 2020

Vars

apptitle="YOUR APP NAME"
version="1.0"

Set Icon directory and file

iconfile="/System/Library/CoreServices/Finder.app/Contents/Resources/Finder.icns"

response=$(osascript -e 'tell app "System Events" to display dialog "The first step is to select your USB key\n\nSelect USB to continue Cancel for Quit" buttons {"Cancel","USB"} default button 2 with title "'"$apptitle"' '"$version"'" with icon POSIX file "'"$iconfile"'" ')

action=$(echo $response | cut -d ':' -f2)

Exit if Canceled

if [ "$action" == "Cancel" ] ; then
osascript -e 'display notification "Program closing" with title "'"$apptitle"'" subtitle "User cancelled"'
exit 0
fi

@ad-si
Copy link
Author

ad-si commented Dec 18, 2020

Uhm, what exactly am I looking at? 😅

@chris1111
Copy link

chris1111 commented Dec 18, 2020

Uhm, what exactly am I looking at? 😅

a button continue or exit for Text window exactly what you said

Attach button for test
TestButton.command.zip
Try it double clic then see it, open with text edit

@ad-si
Copy link
Author

ad-si commented Dec 18, 2020

I think you misunderstood. What I want is to use the native window closing button. However, as you can see in following screenshot, it is disabled per default:

image

Now the question is: How can I reenable it / activate it?

@chris1111
Copy link

chris1111 commented Dec 18, 2020

I think you misunderstood. What I want is to use the native window closing button. However, as you can see in following screenshot, it is disabled per default:

image

Now the question is: How can I reenable it / activate it?

Ha ok Sorry 😂 You need to edit the MainMenu.nib file with Xcode
Check the Close option

Capture d’écran, le 2020-12-18 à 08 45 27

To do this when you creat the app you need Unchek the box
Capture d’écran, le 2020-12-18 à 08 51 41

@sveinbjornt
Copy link
Owner

Changed in master. New behaviour across the board: All windows now have an enabled close button which quits the app when pressed.

Back in the days, such behaviour was a violation of the Apple Human Interface Guidelines. Apps were to stay open even if their only window was closed. But not even Apple seems to abide by these rules any more, and only old Mac guys like me seem to like them. :/

@ad-si
Copy link
Author

ad-si commented Apr 2, 2021

I just tried this out with the latest HEAD, but the x is still grayed out.
Here is how I use Platypus: https://github.com/ad-si/Perspec/blob/master/makefile

Do I have to enable it somehow?

@sveinbjornt
Copy link
Owner

Strange. Have you tried uninstalling and reinstalling the command line tool? Does this also happen when you create an app using the GUI app?

@ad-si
Copy link
Author

ad-si commented Dec 28, 2021

Have you tried uninstalling and reinstalling the command line tool?

Several times

Does this also happen when you create an app using the GUI app?

When I create an app with the GUI, the x button works.
I've also built all the example apps with make_examples.pl, but "SpeakDroplet" was the only one of them with a working x button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants