title bar solutions?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
watsonjk
Posts: 10
Joined: Mon Apr 02, 2007 2:00 am

title bar solutions?

Post by watsonjk » Wed Apr 30, 2008 3:48 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Apr 30, 2008 4:04 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Apr 30, 2008 5:39 am

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply