I want to have my app save data before closing itself. I can have the user use the quit button (I made myself) that is connected to a function. But I don't know how to call the function when the user closes the app native close button.
Is there a way to call a function when the user uses the close button as mentioned in the screenshot above? Thank you for your time in advance. :)