How to protect objects within a group?

Scott Rossi scott at tactilemedia.com
Thu Jun 20 14:37:55 EDT 2013


Also, when deleting objects via a loop, it's generally better to start
from the number of objects and count down to 1.  The overall object count
is reduced every time an object is deleted and will get out of sync with
the repeat count if starting from 1.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 6/20/13 4:29 AM, "Klaus major-k" <klaus at major-k.de> wrote:

>Hi Graham,
>
>Am 20.06.2013 um 13:04 schrieb Graham Samuel <livfoss at mac.com>:
>
>> I have a kind of drawing space on a card where a user can create
>>graphics. I also have a group showing on this card, which is in fact a
>>group of mixed controls, including both graphics and fields,. I have a
>>button that deletes all the graphics on the card by simply doing a loop
>>from 1 to the number of grcs on the card and deleting each grc as it
>>passes through. My group (which I don't want to delete) clearly is not
>>itself a graphic: nevertheless my button deletes all the graphics in the
>>group, from which it appears that each graphic can be accessed
>>separately even when it' s grouped.
>> 
>> I thought that by setting the selectGroupedControls to false, I would
>>protect the graphics inside the group from being selected. Not
>>apparently if the selection is done by script. I also tried setting the
>>cantDelete of the group to true, and that didn't seem to work either:
>>elements of the group can still be deleted.
>> 
>> Luckily in this specific case there is only the one group on the card,
>>so I can tell my loop not to delete those graphics that have the word
>>"group" in their long ID, and this works.
>> 
>> This seems incredibly clunky: is there another way to distinguish
>>between graphics (or in principle, other objects) within a group and
>>graphics outside?
>
>you can check "the owner of grc xyz" or "the short name of the owner of
>grc xyz" in the repeat loop.
>
>This will be :
>1. INSIDE -> the name of the group -> group "name of group"
>2. OUSIDE -> the name of the the card -> card "name of card"
>
>> TIA
>> 
>> Graham
>
>Best
>
>Klaus
>
>--
>Klaus Major
>http://www.major-k.de
>klaus at major-k.de
>
>
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode
>






More information about the use-livecode mailing list