shutdownRequest handler

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
Christo777
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 13
Joined: Thu Nov 16, 2006 4:34 am

shutdownRequest handler

Post by Christo777 » Fri Jun 29, 2012 2:10 am

Hi,
when I quit my standalone app, this code should execute but it does not. It is in the script of the main stack.
Have an idea ? tx

Code: Select all

on shutdownRequest
   answer question "Are you sure you want to quit?" with "Yes" or "No"
   if it is "Yes" then 
      send closecard to card 1 of stack "Sans titre"
      pass shutdownRequest -- allow to quit
   else
      answer "we don't quit"     
   end if
end shutdownRequest
I just found that if I issue a Quit command from a button, the previous script does execute ! But if the user chooses Quit MyApp from the App menu, it does not. How do I trap this ??

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: shutdownRequest handler

Post by shaosean » Fri Jun 29, 2012 6:44 am

http://lists.runrev.com/pipermail/use-l ... 12239.html

You can always try trapping for the Quit AppleEvent as mentioned in this posting

Christo777
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 13
Joined: Thu Nov 16, 2006 4:34 am

Re: shutdownRequest handler

Post by Christo777 » Sat Jun 30, 2012 3:29 am

I can try that but that would solve only half of the problem (on MacOS only).
For the other platforms, can I trap the "Quit" menuitem in my File menu button ?

I really would want to know why my handler doesn't catch the request.
Should I put this question in another topic of the forum ?

Thank you

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: shutdownRequest handler

Post by shaosean » Sat Jun 30, 2012 10:04 am

Are you setting the lockMessages property anywhere in your code?

Post Reply