Was: openstack or preopenstack confusing... Now "User Contributed Notes" for RunRev Dictionary

J. Landman Gay jacque at hyperactivesw.com
Wed Nov 11 16:51:49 EST 2009


william humphrey wrote:
> But if you put the closeStack in the background script of the main stack
> then you're back to the original problem. It gets called when you close one
> of the substacks.
> 
> I notice it is working OK but it may be because that first card is always
> open when the program is open (it's the central part of the interface) but
> your comment makes me worry about the functionality of closeStack for other
> users.

It just depends on what the stack needs to do. In this case, since only 
the mainstack uses a closestack handler, and the mainstack is open at 
card 1 all the time, putting closestack into the card script is fine. 
The handler will always be called. If your mainstack needed to see a 
closestack handler from any card, then it would have to go into the 
stack script (alternately, if all cards shared a background group, it 
could go there.)

If you want the mainstack and all substacks to get the closestack 
handler, put it into the mainstack's stack script.

If you want only some stacks to get a closestack handler, or if your 
mainstack may close from a card other than card 1, put the handler into 
the stack script and do a test inside the handler to see if the right 
stack is frontmost before acting on it.

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



More information about the use-livecode mailing list