[Solved] Moving group problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
[Solved] Moving group problem
I thought I understood groups, and the path, but apparently no so much.
I have a group of images I have been using in a project on a subStack. I had later decided (but of course, not before assigning all the images over a LOT of cards of the mainStack) to put the group on a card in the mainStack. I am finding this to be more difficult than I thought initially. Some mistakes in my assumptions were -
. I thought a 'shared' group, no matter its location, was shared throughout the project so that, lets say you copied or cut the group, then pasted it, the items inside would retain their ID. Turns out this is incorrect.
. I thought that a shared group, even on a substack, would still follow the message path of card -> substack -> mainstack (it does, kinda, if I assign a button icon by id of the group, it works), but I am unable to use the place command to place the group on a card in the mainstack.
. I thought I should be able to drag the card the group is on from the substack to the mainstack without changing the IDs, but this is also incorrect.
I am really not looking forward to actually going through each of the cards and manually changing the icon IDs for each button, but that is where I am at at the moment, so in desperation. and after many searches for what I am missing, I am reaching out to see if anyone has a suggestion or method to move a shared group from a card in a substack to the mainstack without changing the IDs of all the images in the group, or alternately, an explanation of why something that seems so simple actually is not (See Craig, my brother, your not the only one that comes up with these lu-lu things )
I have a group of images I have been using in a project on a subStack. I had later decided (but of course, not before assigning all the images over a LOT of cards of the mainStack) to put the group on a card in the mainStack. I am finding this to be more difficult than I thought initially. Some mistakes in my assumptions were -
. I thought a 'shared' group, no matter its location, was shared throughout the project so that, lets say you copied or cut the group, then pasted it, the items inside would retain their ID. Turns out this is incorrect.
. I thought that a shared group, even on a substack, would still follow the message path of card -> substack -> mainstack (it does, kinda, if I assign a button icon by id of the group, it works), but I am unable to use the place command to place the group on a card in the mainstack.
. I thought I should be able to drag the card the group is on from the substack to the mainstack without changing the IDs, but this is also incorrect.
I am really not looking forward to actually going through each of the cards and manually changing the icon IDs for each button, but that is where I am at at the moment, so in desperation. and after many searches for what I am missing, I am reaching out to see if anyone has a suggestion or method to move a shared group from a card in a substack to the mainstack without changing the IDs of all the images in the group, or alternately, an explanation of why something that seems so simple actually is not (See Craig, my brother, your not the only one that comes up with these lu-lu things )
Last edited by bogs on Mon Nov 27, 2017 9:04 pm, edited 2 times in total.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Moving group problem
Bogs.
Sharing is within a stack or substack. It follows the HC paradigm, somewhat, of an actual distinct object class, lying between the card and the stack. As such, it does not know or care about other stacks or substacks.
As such again, your
Craig Newman
Sharing is within a stack or substack. It follows the HC paradigm, somewhat, of an actual distinct object class, lying between the card and the stack. As such, it does not know or care about other stacks or substacks.
As such again, your
needs to place the shared (backGround behavior set) group between the card and the stack.follow the message path of card -> substack -> mainstack
Um, nope. You can copy cards from one place to another, though.I thought I should be able to drag the card the group is on from the substack to the mainstack
Craig Newman
Re: Moving group problem
Yah, that is pretty much the wall I'm running into now. Sure makes me wish I had spent more time playing with Hypercard when it had come out.
Yes, I can even copy the group from one stack to the other. I can understand it changing the picture IDs on copy, since there is now 2 of the same picture. The thing that stump(s) me though, is that even if I cut the pictures and then paste them, the IDs still change! I mean, that should be a one to one replacement, shouldn't it ? I have to admit, I am having a hard time understanding that oneYou can copy cards from one place to another, though.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Moving group problem
Someone like Jacque or Klaus will know better, But I think in any single session, deleting a control also sets its ID aside so It cannot be used again.
I might be wrong about that.
Craig
I might be wrong about that.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Moving group problem
Every stack maintains its own set of IDs. It has to, because pasting in a control could easily have the same ID as another existing control in the target stack. That would create ID conflicts and some very unexpected results.I am reaching out to see if anyone has a suggestion or method to move a shared group from a card in a substack to the mainstack without changing the IDs of all the images in the group, or alternately, an explanation of why something that seems so simple actually is not
LC maintains a list of reserved icon IDs (I think it's in the icon entry in the dictionary) and if you want to share icons across many stacks it's wise to assign the images very high IDs that are unlikely to be used elsewhere. Store the images somewhere in the mainstack (an unused card, an unplaced group, etc). Then you can assign those icons to the controls in the group and they should be found when you copy the group elsewhere, provided the containing stack is in the search path. I generally start my custom ID numbers at 300,000.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Moving group problem
That's right, but it isn't just for the session, it's forever. IDs are used once per stack. When they're gone, they're gone.
Every stack starts with an ID of 1001 and counts up from there. BTW, if you renumber IDs as I suggested, the IDs for any new controls will begin counting up from there. IDs only march forward.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Moving group problem
Thank you both so much for correcting my profound lack of understanding, now at least I get it, and I am sure I will not forget it.