'Quit' mystery
Mark Smith
Mark_Smith at cpe.umanitoba.ca
Wed Nov 11 20:54:47 EST 2015
I am just coming back to LC after a few months off (18 perhaps?) so I am a
bit rusty but is it not the case that the message path goes from substacks
to the main stack? If so, should not a "shutdownRequest" message not handled
in a sub stack be passed up the message path to the main stack? In which
case you don't need shutdownRequests in each sub, just in the main? I am
actually at the very point where I need to implement a somewhat similar
feature (pressing the "home" key on an iDevice shuts-down your application -
and I need to handle that gracefully. Hoping, hoping I do not need to code a
shutdown message handler in every substack)
Mark
Howard Bornstein-2 wrote
>> Each of the substacks' scripts have a shutdownRequest handler but not a
>> 'pass shutdownRequest' command. This handler sends a prepareToQuit
>> command
>> to the main card of the main stack.
>>
>> substack stack script
>> -------------------
>> on shutdownRequest
>> send "preparetoquit" to card "main" of stack "mainstack"
>> end shutdownRequest
>> ------------------
>> The main card of the main stack has the prepareToQuit handler which just
>> has
>> a quit command. This triggers the shutdownRequest handler in the main
>> card.
>> This shutdownRequest handler has all of the code you want implemented
>> before
>> quitting. This handler has the 'pass shutdownRequest' command that
>> allows
>> the application to quit.
>>
>> Mainstack >card "main" script
>> -----------------------
>> on preparetoquit
>> quit
>> end preparetoquit
>>
>> on shutdownRequest
>>
> <do stuff here>
>>
>> pass shutdownRequest
>> end shutdownRequest
>>
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Quit-mystery-tp4672924p4698720.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list