Quitting Question

Mark Schonewille m.schonewille at economy-x-talk.com
Tue Nov 16 17:21:46 EST 2010


Joe,

Those messages can be cought, but should not be sent. When you click in the closebox, the closeStackRequest is sent. When you choose Quit in the application menu, the shutdownRequest message is sent. The Quit menu item only works on windows! Just to be save, execute the script attached to the Quit menu item only on Windows and Linux:

case "Quit"
  if the platform is in "Win32,Linux" then
    quitMyProject
  end if
break

To handle the Quit menu item on Mac OS X, do the following:

on shutdownRequest
  quitMyProject
end shutdownRequest

If the quitMyProject locks the messages, then the closeStackRequest and the shutdownRequest messages will not be sent a second time when the quitMyProject calls the quit command (this is important).

You need to adjust the quitMyProject handler a little. You might need to add lines for certain externals, such as revSpeak, you might want to remove the lines with regard to databases if you don't use any.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Follow Economy-x-Talk on Facebook now and get a free Color Converter license http://qurl.tk/gn (read the conditions)

On 16 nov 2010, at 22:42, Joe Lewis Wilkins wrote:

> Ooops, not so perfectly. It doesn't quit when you don't want to save. Oh well. A work in progress. (smile)
> Joe Lewis Wilkins
> Architect
> 760-738-1721
> 
> 
> 
> 
> 
> On Nov 16, 2010, at 1:39 PM, Joe Lewis Wilkins wrote:
> 
>> Hi Mark,
>> 
>> Since I got it to work perfectly, I thought some others might appreciate a snippet! Probably a neater and shorter way of doing this, but what the heck! I suppose I could have just gone for the name of the application, but this is generic enough to handle any stack with any standalone name.
>> 
>> Joe Wilkins
>> 
>> case "Quit" 
>>        get the long name of this stack
>>        delete the last char of it
>>        put the number of chars in it into numChars
>>        put Char (numChars-2) to numChars of it into myName
>>        if myName is "rev" then
>>           closeStackRequest
>>        else
>>           shutDownRequest
>>        end if 
>>        break




More information about the use-livecode mailing list