Quit
Peter Brigham MD
pmbrig at gmail.com
Mon Jan 10 09:02:05 EST 2011
On Jan 9, 2011, at 7:40 AM, Richmond wrote:
> I want to disable the ability of Mac users to QUIT
> by pressing Command-Q; tis is to force them to
> use localised QUIT buttons (each with slightly
> different characteristics) on cards within a stack.
This is in my saved tidbits stack, from a discussion a while back,
maybe it will help:
------------
From: Mark Schonewille <m.schonewille at economy-x-talk.com>
Date: Fri, 16 Nov 2007 01:16:34 +0100
Re: Re: saving data in a standalone before quit
(Was Re: (mac) application menu)
Peter,
When you use the Quit menu item, Mac OS X sends an event to
Revolution. You can catch this message with the AppleEvent handler or
the shutdownRequest handler. On Mac OS X, I prefer to use the
AppleEvent handler most of the time.
If you use either the AppleEvent handler or the shutdownRequest
handler without a pass command, the application will not quit by
itself (you can also lock messages and issue the quit command).
When you press command-Q, the Quit menu item should work just like
when you use the mouse to select this menu item and you can catch the
AppleEvent and shutdownRequest messages again. However, your script
may catch the commandKeyDown message. If you don't pass this message
with the pass command, your application may not quit.
There are versions of Revolution that don't pass the commandKeydown
message because of a bug. There are also versions that don't pass the
AppleEvent message.
If you are using Rev 2.8.1, problems with quitting are probably due to
a script.
Best regards,
Mark Schonewille
Op 15-nov-2007, om 23:08 heeft Peter Brigham het volgende geschreven:
> Now, the other mystery -- I convert my stack to a standalone (now
> with the correct application name in the Mac manubar!) and when I
> select "quit <myApp> from the application menu, nothing happens.
> Anyone have any ideas what could cause this behavior? Per my
> previous experiments, this is probably *not* due to anything in my
> scripting, as it seems that the quit command is handled by the
> system. So what could be the problem?
********
From: Marty Knapp <martyknapp at comcast.net>
Date: Sat, 17 Nov 2007 11:04:20 -0800
On: How to use Revolution <use-revolution at lists.runrev.com>
Re: (mac) application menu
This was driving me crazy too. After messing around with it, I pieced
the following together and it's worked for me (I am using Rev 2.6.1):
on appleEvent pClass,pID,pSender --I got this from Ken Ray's web site
switch (pClass & pID)
case "aevtquit"
answer "Save changes?" with "Don't Save" or "Save"
if it is "Save" then
doSaveStuff
pass appleEvent
else pass appleEvent
break
default
pass appleEvent
break
end switch
end appleEvent
on closeStackrequest
Global homeStack
if the short name of this stack is homeStack then
answer "Save changes?" with "Don't Save" or "Save"
if it is "Save" then
doSaveStuff
end if
end if
pass closeStackrequest
end closeStackrequest
on shutdownRequest --I only use this for Windows
Global homeStack
if the platform contains "Win" then
if the short name of this stack is homeStack then
answer "Save changes?" with "Don't Save" or "Save"
if it is "Save" then
doSaveStuff
end if
end if
end if
pass shutdownRequest
end shutdownRequest
Marty Knapp
More information about the use-livecode
mailing list