Destroying cloned stacks

Jeffrey Massung massung at gmail.com
Sun Feb 21 22:08:31 EST 2010


I assume this is a pretty simple problem, but it just caused me to lose a good 3 hours of work (teach me to not backup!)...

I have an app that is similar to a multi-document app. User says File -> Open and a clone of the document stack opens up. The user does some stuff and then closes it. Many documents may be open at once.

My code generally goes like so (which may be wrong as I just lost 3 hrs and am typing this before trying again)..

Main Stack:

on newDocument
   clone stack "Document"

   ## setup document stack here...

   go to it
end newDocument


Document stack:

on closeStack
   destroy this stack
end closeStack


Now, the reason for the destroyStack is that I don't want the Application Browser (or my app when I save it) to be bombarded with clone after clone of my document stack. But, as things are what they are, I closed the _actual_ document stack and BAM, lots of work gone.

So, my questions:

1. Am I going about creating a document stack the right way?
2. How can I nuke clones and not the primary document stack?

Thanks!

Jeff M.


More information about the use-livecode mailing list