Can I open up many instances of a single substack?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 8
- Joined: Tue Feb 14, 2012 4:55 pm
Can I open up many instances of a single substack?
Hi:
For an application I'm working on, I have a mainstack which contains a list of database items and a button to create a new item.
Every time somebody double-clicks on the list of items I want to open a new instance of a substack which displays an editor/display for the that particular item of data.
Can anybody help me?
-
Jay
For an application I'm working on, I have a mainstack which contains a list of database items and a button to create a new item.
Every time somebody double-clicks on the list of items I want to open a new instance of a substack which displays an editor/display for the that particular item of data.
Can anybody help me?
-
Jay
Re: Can I open up many instances of a single substack?
Hi Jay,
You need to clone your stack and rename it.
Somehow every name needs to be unique. The milliseconds is not perfect but should be sufficient. You could also script a counter, which remembers how many "New Stacks" are open already or count them every time with a repeat loop that checks all open stacks.
Kind regards,
Mark
You need to clone your stack and rename it.
Code: Select all
clone stack "Original Stack"
set the name of it to ("New Stack" && the milliseconds)
Kind regards,
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 8
- Joined: Tue Feb 14, 2012 4:55 pm
Re: Can I open up many instances of a single substack?
Thanks much, Mark!
I can use the name of the data item which, by definition, will be unique. For "new" items, I'll assign a "New Ship " & a counter, until the user names the item. And I'll check when the user wants to open something if it's already opened so that I can just bring that stack to the front.
-
Jay
I can use the name of the data item which, by definition, will be unique. For "new" items, I'll assign a "New Ship " & a counter, until the user names the item. And I'll check when the user wants to open something if it's already opened so that I can just bring that stack to the front.
-
Jay
Mark wrote:Hi Jay,
You need to clone your stack and rename it.
Re: Can I open up many instances of a single substack?
Wouldn't it be more compact and far easier to manage if you made a new card in a single stack rather than millions of new stacks?
Craig Newman
Craig Newman
Re: Can I open up many instances of a single substack?
Craig,
That might be the case, but not if you want to be able to compare different items simultaneously in different windows.
Kind regards,
Mark
That might be the case, but not if you want to be able to compare different items simultaneously in different windows.
Kind regards,
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 8
- Joined: Tue Feb 14, 2012 4:55 pm
Re: Can I open up many instances of a single substack?
Thank you Mark. That is exactly what I'm trying to do.Mark wrote:Craig,
That might be the case, but not if you want to be able to compare different items simultaneously in different windows.
Kind regards,
Mark
If only there was a way to create a virtual clone of the stack without having to have it copied to the disk. Oh well.
-
Jay
Re: Can I open up many instances of a single substack?
Hi Jay,
I don't understand your last remark. Clones only exist in memory until you ave them.
Mark
I don't understand your last remark. Clones only exist in memory until you ave them.
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Can I open up many instances of a single substack?
Mark is correct: when you clone a stack it''s a copy of the original in all respects except that it isn't associated with any file, living only in memory.DangerousThing wrote:If only there was a way to create a virtual clone of the stack without having to have it copied to the disk.
If you want to save a cloned stack you can set its filename property, and then use the save command to save it.
But without that, it's only in RAM, very much like creating a new document in most document-centric applications.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Can I open up many instances of a single substack?
Yes, that's what I said, indeed.
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 8
- Joined: Tue Feb 14, 2012 4:55 pm
Re: Can I open up many instances of a single substack?
Thank you. I had only read the definition in the LiveCode dictionary and it just talks about the "newly created object".Mark wrote:Hi Jay,
I don't understand your last remark. Clones only exist in memory until you ave them.
Mark
Your clarification makes it sound absolutely perfect for my needs. I'll have to try it out later tonight.