How to set up a substack from 2 mainstacks

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Iluvatar
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 8
Joined: Fri Apr 09, 2010 8:59 am

How to set up a substack from 2 mainstacks

Post by Iluvatar » Sun Mar 17, 2013 10:39 am

I have 2 debugged stacks (both mainstacks at present).

How do I set these up so that one is a substack of the other (at runtime); and they display their respective first cards?

I have been trying a few things but no good so far .....

Thanks.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: How to set up a substack from 2 mainstacks

Post by sturgis » Sun Mar 17, 2013 4:35 pm

Open both stacks. Look at the property inspector for the stack you wish to be a substack

set its mainstack property to point at the stack that you want to be main.

Save the mainstack. At this point you will still have a copy of the stack that is now a substack, but there is also a copy integrated into the stackfile of the mainstack.


If you want both stacks to open on launch you can add code to your mainstack (in openstack, opecard or wherever seems appropriate for your purposes) that will open the substack.
go stack "stackname" will open and focus on the stack. Since its now a substack you don't have to specify a file path. (though if you want each to remain as mainstacks you can go stack "/path/to/stackfile.livecode"

Post Reply