Substack from another stacks substack

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Substack from another stacks substack

Post by quailcreek » Fri Feb 09, 2007 7:57 pm

I'm going to feel foolish when I see the answer but I still need to know. How do I add substackZ of stack "A" to be substackZ of stack "B"?

Thanks a lot
Tom

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Feb 10, 2007 1:35 am

Tom,

If you want to add a copy of a substack to another substack, you need to clone it first and then set the mainstack of the new stack.

Code: Select all

clone stack "Substack Z"
set the name of it to "Substack X"
set the mainstack of stack  "Substack X" to "Mainstack A"
Perhaps we should submit a feature request for a "Duplicate this Stack" menu item.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Post by quailcreek » Sat Feb 10, 2007 3:24 am

Hi Mark,
I probably should have said why I wanted to do this and you may have responded differently. I want to get the substack calendarWidget100 from the altAnswerDateHarness stack. Maybe there's a better way to accomplish this. Sorry for not being clearer.

Tom

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat Feb 10, 2007 10:48 am

Hi Tom,

The answer stays the same, but now that I understand that you need this only once, I can add the following.

Open the property inspector of stack calendarWidget100. Use the mainstack option menu to change its mainstack to your own stack. Close stack altAnswerDateHarness, make sure not to save it and that it is actually removed from memory. This can easily go wrong, so you might want to make a backup of altAnswerDateHarness. Save your own stack and you're ready.

(I think that cloing the stack by running aforementioned script from the message box is easier and more secure).

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply