Page 1 of 1
title bar solutions?
Posted: Wed Apr 30, 2008 3:48 am
by watsonjk
Closing stacks with the close button on the title bar in a standalone on Mac OSX, all changes are lost without warning.
I'd like to a) give the user a dialog prompting a save, b) hide the title bar or c) something else that will keep this from happening.
Anything I can do? Thanks in advance.
Jim
Posted: Wed Apr 30, 2008 4:04 am
by Mark
Hi Jim,
You can use the closeStackRequest message to run a script that asks the user whether s/he really wants to close the programme etc. If the user confirms and doesnt' cancel any file saving prompts, you can pass the message. If the user cancels, don't pass the message.
Best,
Mark
Posted: Wed Apr 30, 2008 5:39 am
by Janschenkel
And if you want the same thing to happen when the user tries to quit your application on MacOSX, make sure to trap the 'shutdownRequest' message in an appropriate place.
If your data is supposed to be saved in a stack, and not some other storage facility such as a database or a custom text or binary file format, you'll also want to consider the following:
- you cannot save stacks that are part of the standalone
- the 'save' command will do what you want.
In any case, you'll want to read this article by Sarah Reichelt on RevJournal:
http://www.revjournal.com/tutorials/sav ... ution.html as it gives you plenty of information.
Hope this helped,
Jan Schenkel.