UPDATE: Make stack close itself
Bob Sneidar
bobsneidar at iotecdigital.com
Wed May 21 14:40:05 EDT 2014
Hey putting an on idle handler in the open substack then passing idle worked! Nice catch for sure Alejandro. So the lesson here is, if a handler belonging to a script anywhere in a running stack, issuing close this stack will not do so, understandably. (I know others have shown me how it works OK, but that is only because they have no on closeStack or on closeStackRequest handlers in their scripts anywhere as I have).
That being said, this can be worked around with an idle handler, so long as there is an on idle handler somewhere in the message path. Curious though, how when it was in a back script, that wasn’t considered by the LC engine to be in the message path, though clearly it was because issuing idle from the message box triggered the handler.
It sure would be nice if in a future update, close this stack could be queue’d in such a way that it would not execute until all running handlers in that stack had terminated, but that is probably too much to ask.
Bob S
On May 21, 2014, at 11:31 , Bob Sneidar <bobsneidar at iotecdigital.com<mailto:bobsneidar at iotecdigital.com>> wrote:
Okay well that is making a little more sense. So if I put an on idle handler in all my stacks and then pass the message, it should filter down to my mainstack. I suppose I could insert the stack-closing-code in all my substacks, but that makes me feel dirty somehow. ;-)
Bob S
More information about the use-livecode
mailing list