The other way of handling this is to have a mainstack that is really just a 
splash stack + library, it doesn't even have to show itself on startup (put "on 
preopenstack; hide this stack; end preopenstack" into the script of card 1 of 
the mainstack). Then put whatever you want for preopenstack behaviors in 
individual substacks, and don't put anything in the mainstack script except 
your library of handlers that need to be available in all stacks. Of course if 
there is default preopenstack behavior you need to have operating for all the 
substacks, you can put that in the mainstack script. Any substack that has its 
own preopenstack handler will trap the message (unless you pass it), and any 
stack without its own preopenstack handler will not intercept the preopenstack 
message and the mainstack script will catch it and handle the default action.

If you're planning on making a standalone, you don't want your library in the 
mainstack -- in that case a truly minimal mainstack script is called for, and 
the library of common handlers should be in a separate library stack that is 
put in use by the mainstack when it opens.

-- Peter

Peter M. Brigham
[email protected]
http://home.comcast.net/~pmbrig

On Sep 9, 2011, at 5:59 PM, Jonathan Lynch wrote:

> I always put empty preopenstack, openstack, preopencard,
> and opencard handlers for my substacks. I also put in a closestack handler
> in the substack that tells the substack to close. This seems like it should
> just be a standard thing to do when making substacks. This will prevent any
> stray messages from traveling up to the mainstack and causing problems.
> 
> On Fri, Sep 9, 2011 at 5:40 PM, J. Landman Gay 
> <[email protected]>wrote:
> 
>> On 9/9/11 2:09 PM, Scott Rossi wrote:
>> 
>>> Recently, Gregory Lypny wrote:
>>> 
>>> I have a main stack with a PreOpenStack handler and sub-stacks with
>>>> PreOpenStack handlers.  Why is it that when I click a Go button in the
>>>> main
>>>> stack that opens a sub-stack, the PreOpenStack handler in the main stack
>>>> is
>>>> executed?
>>>> 
>>> 
>>> Messages from substacks automatically "fall through" to the script of the
>>> mainstack.  If you don't want this behavior, you can:
>>> 
>> 
>> Except it should go card -> substack stack script -> mainstack stack
>> script. I thought.
>> 
>> Greg says it doesn't.
>> 
>> --
>> Jacqueline Landman Gay         |     [email protected]
>> HyperActive Software           |     http://www.hyperactivesw.com
>> 
>> 
>> ______________________________**_________________
>> use-livecode mailing list
>> [email protected]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>> 
> 
> 
> 
> -- 
> Do all things with love
> _______________________________________________
> use-livecode mailing list
> [email protected]
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to