Best Practice: Prevent Substacks from Triggering Main Stack Scripts

J. Landman Gay jacque at hyperactivesw.com
Fri Feb 6 15:33:40 EST 2015


On 2/6/2015 12:49 AM, Brahmanathaswami wrote:
> If you put any preopenstack, resizestack, close stack etc. script in the
> mainstack script.. these will be triggered by the same action in a
> substack.
>
> What is the best way to avoid this?

I usually do the thing where you put the open* handlers into the first 
card of the mainstack. It's easiest.

If there are handlers that should be shared, but only with a few stacks, 
I put those handlers into the mainstack and check in the first line of 
the handler to see if the target is one of the stacks it needs to work 
with, and if not it exits.

If almost everything needs to use the open* handlers except one or two 
stacks, then I put the handlers into the mainstack stack script and put 
blocking handlers into the stacks that are an exception.

So I guess the answer is...it depends.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list