Page 1 of 1

Cloning across stacks

Posted: Wed Mar 29, 2023 12:13 pm
by richmond62
This sort of stuff is dead easy:
-
SShot 2023-03-29 at 14.12.25.png
-

Code: Select all

on mouseUp
   clone me
   set the left of the last img to the right of img "Ewe"
   set the top of the last img to the bottom of img "Ewe"
end mouseUp
BUT, being a spoilt child I am not satisfied with that and want things so that when I click on the sheep
it clones onto another stack . . .

BUT . . . Ooooer:
-
SShot 2023-03-29 at 14.17.36.png
SShot 2023-03-29 at 14.17.36.png (19.16 KiB) Viewed 5045 times

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 12:31 pm
by richmond62
This MUST be doable as one can do a double-click on an object on the revTools stack to clone
that object across onto one's own stack.

This DOESN'T:

Code: Select all

on mouseUp
   palette "Dolly the Sheep 2"
   wait 5 secs
   copy me
   paste into topStack()
   end mouseUp
and nor does this:

Code: Select all

on mouseUp
   palette "Dolly the Sheep 2"
   wait 5 secs
   copy me
   paste
   end mouseUp
BUT: maybe I'm doing 'things' the wrong way round.

Err . . . NO . . . obviously not:

Code: Select all

on mouseUp
   copy me
   palette "Dolly the Sheep 2"
   wait 5 secs
   paste
   wait 5 secs
   topLevel "Dolly the Sheep 2"
end mouseUp

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 12:44 pm
by Klaus
What's wrong with this one-liner:

Code: Select all

on mouseup
  copy me to stack "the other one"
end mouseup
? 8)

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 1:17 pm
by richmond62
What's wrong with this one-liner:
Nothing, IF one already knows the name of the target stack.

HOWEVER, I have no urge to hard code the name of the target stack into the scripts of objects
on my starter stack.

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 1:48 pm
by richmond62
OK: Gotcha:

Code: Select all

on mouseUp
   palette "Dolly the Sheep 2"
   put the short name of the topStack into TPSTK
   topLevel "Dolly the Sheep 2"
   copy me to stack TPSTK 
end mouseUp
-
SShot 2023-03-29 at 15.46.47.png
-
Thank you very much, Klaus.

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 3:06 pm
by richmond62
My 'oversight', if that's the right word for it, was that I thought a copy command always had to be followed by a paste command.

Code: Select all

on mouseUp
   palette "Dolly the Sheep 2"
   put the short name of the topStack into TPSTK
   topLevel "Dolly the Sheep 2"
   copy me to stack TPSTK 
end mouseUp
That odd little dance where the originating stack is temporarily palettised is so that one can
copy the object to the target stack when one does not know its name: otherwise one ends
up doing what I was doing at the start of this thread and simply duplicating on the originating
stack.

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 4:59 pm
by Klaus
Maybe this will work for you, since a "mouseenter" is also sent if that stack is currently not the topstack.
"t2" is the topstack, button script in stack "t1":

Code: Select all

on mouseEnter
   put the topstack   
end mouseEnter
Bildschirmfoto 2023-03-29 um 17.56.25.png

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 5:48 pm
by richmond62
My next concern is how to get a 'clone' script into the cardScript so that I don't have replicate that script across 100 different objects.

But, as I am busy cooking a 3 course supper downstairs, my wife having had a fun-packed day of tedious committee meetings and admin. guff, she will come home with an appetite that will be of homeric proportions, things will have to wait a bit.

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 6:07 pm
by richmond62
Well, Whacky-Doo: a 2 minute job:
-
SShot 2023-03-29 at 20.05.41.png
-
In the cardScript:

Code: Select all

on mouseUp
   put the target into TARGE
   palette "Target Practice"
   put the short name of the topStack into TPSTK
   topLevel "Target Practice"
   copy TARGE to stack TPSTK
end mouseUp

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 6:10 pm
by richmond62
The next Q is whether things will work if the originating stack is ALWAYS a palette:
-
SShot 2023-03-29 at 20.08.52.png
-
Super . . .

Code: Select all

on mouseUp
   put the target into TARGE
   --palette "Target Practice"
   put the short name of the topStack into TPSTK
   --topLevel "Target Practice"
   copy TARGE to stack TPSTK
end mouseUp

Re: Cloning across stacks

Posted: Wed Mar 29, 2023 6:13 pm
by richmond62
My reason for this is that I should like to make a 'super palette' containing a large number of SVG images
for use inwith LC/OXT for wireframe prototyping . .

I am trying to lay my sweaty paws on ALL the SVGs in LibreOffice Draw to import them into a palette:
as they are Open Source they should be up for grabs, but I am far too lazy to export each one individually from an OO Draw document.

Or, for that matter, from Pencil.

https://pencil.evolus.vn/

Does anyone have any pointers?

Re: Cloning across stacks

Posted: Sat Apr 01, 2023 6:55 pm
by richmond62
SShot 2023-04-01 at 20.53.46.png
-
FREE :D