Edit Group problem

Graham Samuel livfoss at blueyonder.co.uk
Tue Oct 21 14:37:30 EDT 2003


I'm experimenting to see how easy it is to add items to a group 
temporarily (to facilitate moving the items round the screen 
together, either by script of by the user dragging them and the group 
reacting to a 'grab' command) and later removing the items again. 
I've succeeded in adding an image to the group by :

on mouseUp
   copy image "face.gif"
   start editing grp "TheGroup"
   paste
   set the bottom of image "face.gif" to the bottom of grc "Graphic 2"
   -- the above line refers to objects inside the group
   stop editing background "TheGroup"
end mouseUp

However, when I want to get rid of the new item from the group, this 
script (in another button) doesn't work.

on mouseUp
   start editing grp "TheGroup"
   delete image "face.gif" of grp "TheGroup"
   stop editing background "TheGroup"
   paste
end mouseUp

Not only does the image not get deleted, but the whole display seems 
to stay in 'group edit' mode until I switch from browse to select 
mode and back in the IDE's tool palette. I tried just doing

   delete image "face.gif"

even though I could see this might have picked up the wrong copy of 
the image, but anyway it didn't work either.

It all works perfectly well in the IDE, using the tools provided and 
selecting the image via the mouse.

Can't see what I'm doing wrong.

TIA

Graham

BTW I find it kind of odd that I have to use the word 'background' in 
the 'stop editing'but not elsewhere (it's in the TD).
-- 
-------------------------------------------------------------------
          Graham Samuel / The Living Fossil Co. / UK & France


More information about the Use-livecode mailing list