background owners (and Re: unplaced grp)

Dave Cragg dcragg at lacscentre.co.uk
Tue May 20 15:50:02 CDT 2003


>>  Is there a quick way to know which of a stack`s backgrounds (groups with
>>  background behavior set to true) are on no card?
>>  (snip)
>>  The problem is that for backgrounds on *unvisited* cards the owners are
>>  returned as "stack" even when the real owner is the card.
>>
>>  A workaround is to first go to all cards of a stack - and only after
>>  that ask for the owners of backgrounds - but this takes extra seconds
>>  for large stacks on slower computers
>>  (snip)
>>  Is there a direct way to determine which backgrounds are on no card at
>>  all?
>>
>In the meantime I have tried the "long name" and the "long ID"
>properties to directly identify "unplaced" backgrounds. The results are
>the same as with the "owner" property:
>Both "unplaced" backgrounds -. that have only the stack as its owner -
>and backgrounds placed on cards you did not go to before - return the
>"stack" as owner or the next object up in the hierarchy.
>So the above described workaround is necessary here, too, to find the
>real "unplaced" backgrounds.
>
>Any other suggestions what to try else to find directly unplaced
>backgrounds?--

You can get a list of the backgrounds in the stack with the 
backgroundnames property. Then loop through each line, checking for 
"the number of cards of background <whatever> = 0"

repeat for each line tBG in the backgroundnames of this stack
   if the number of cards of background tBG = 0 then
     put tBG & return after tList
   end if
end repeat
## do something with tList

Cheers
Dave



More information about the use-livecode mailing list