Intercepting shutdown attempts

Alex Tweedly alex at tweedly.net
Thu Apr 7 08:23:12 EDT 2005


I have an app that needs to save some data before the app quits.

When the users quits from the menu (or shortcut), it's easy - but I 
can't seem to find out if they quit by clicking the 'close' ("X") box in 
the window decorations.  I read about "shutdown" and "shutdownrequest" 
messages in the docs - so I added handlers for those to the stack's 
script - but they don't seem to be invoked.

The stack script now looks like

on shutdown
  answer "shutdown"
end shutdown
on shutdownrequest
  answer "shutdownrequest"
end shutdownrequest

When I quit via the menu (which uses the "quit" command), it calls the 
shutdownrequest handler - but not when I click on the "close" ("X") icon.

Am I missing something obvious here ?

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.2 - Release Date: 05/04/2005



More information about the use-livecode mailing list