shutDownRequest ignored - yes, it -is- a reproducible bug

Thierry Arbellot thierry.arbellot at wanadoo.fr
Sun Sep 7 08:20:01 EDT 2003


Barry,

I have tried your example and I can make it work :
I just added the shutdownRequest handler in BOTH stacks.

The first time I select the "Quit" menu, the "shutdownRequest" message 
is sent to the "maintest" stack.
But, from the 2nd time, the message is sent to the "splashtest" stack.

Actually, it's a bug.

The documentation says the "shutdownRequest" message is sent to the 
current stack, that is defined by the defaultStack property.
The defaultStack property is always sets to "maintest".
Then the "shutdownRequest" message should always be sent to the 
"maintest" stack.

Hope it helps.

Thierry

On Sunday, September 7, 2003, at 07:56 AM, Barry Levine wrote:

> Consider the following two handlers. Both allegedly will intercept the 
> "Quit" when selected from the OSX app menu. In both cases, with 
> multi-stack apps, either handler (I only use one or the other) will 
> only be executed the first time it is called.
> ---------------------------------------------------------------
> on shutDownRequest
>    answer information "Are you sure you want to quit?" with "Quit" or 
> "Don't Quit" as sheet
>    if it is "Quit" then pass shutDownRequest
> end shutDownRequest
> ---------------------------------------------------------------
> on appleEvent theClass,theID
>   if theClass is "aevt" and theID is "quit" then
>     answer information "Are you sure you want to quit?" with "Quit" or 
> "Don't Quit" as sheet
>     if it is "Quit" then pass appleEvent
>   end if
> end appleEvent
> ---------------------------------------------------------------
>
> I can reproduce this "works only the first time" behavior. Here is how 
> I did it:
>
> 1. Create a stack. Let's call it "splashtest". Save it as 
> "splashtest.rev". Add this handler to the stack script:
>
> on openStack
>   wait 2 seconds -- so we can see we're here
>   hide this stack
>   go stack "maintest.rev"
> end openStack
>
> 2. Save and close the stack.
>
> 3. Now create that "maintest" stack and save it in a file named 
> "maintest.rev". Add this handler to the stack script:
>
> on shutDownRequest
>   answer information "Quit?" with "Quit" or "Cancel"
>   if it is "Quit" then pass shutDownRequest
> end onShutDownRequest
>
> 4. Save and close the stack.
>
> 5. Create a Distribution using "splashtest.rev" as the main stack to 
> which the engine will be attached. Add "maintest.rev" to the 
> distribution, as well. Make sure you check the Answer Dialog 
> inclusion. Build it.
>
> 6. Run the app. Select "Quit" from the app menu. You'll get the 
> confirmation dialog. Click "Cancel" and the app will stay running. 
> Select "Quit" from the app menu again. The app will just quit.
>
> QED. This is an OSX bug. I have the stacks and the compiled app I can 
> eMail to anyone who is interested.
>
> Barry
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list