On Thu, 7 Sep 2000, David Bovill wrote:

> I have the idea that I can use groups to simplify the task of complex
> geometry management. The aim is to have each group act as an independent
> object, so that groups can be added or subtracted without having to change
> any of the other existing groups.
> 
> The strategy is:
>     1) For each group to have a "resizeStack" handler
>     2) Each "resizeStack" handler sets the position of every within the
> group unless it is a group, in which case it send a "resizeStack" message to
> the group.

Note that first level groups (those directly on the card) will
automatically get this message, so all you need to do is be sure to
pass it in each handler so that the next group down will get it.

Be very careful sending a standard message to any object and
especially to child objects: you may find yourself in an infinite loop
if the child doesn't handle the message and it makes its way back up
to the parent object (which resends it...).  It'd probably be better
to make up another message to send to the nested groups.

> At the moment the problem I am having is that if I clone the group, the
> scripts within the group seem to affect objects outside the group which
> naturally enough now have the same name. Renaming the group does not help.
> Of course renaming all 40 or so objects solves the problem, as would using
> long names of id's. I was just wandering if there was a simple way of
> restricting the action of a groups scripts to the groups contents?
> 
> Would it work in general to add "of me" to the short name of any object
> referenced. Does this work with objects nested within groups in the group
> concerned?

It should, yes.

> As always, any help appreciated, I'm working on a complex group and it could
> take me a whole day to find out that some unforeseen problem with a naming
> strategy brakes the entire strategy.

Another feature that might be useful is the groupNames and groupIDs
properties of cards.  They return a list of the group objects on that
card, so you can deal with those first level groups separately.
  Regards,
    Scott

> Ta

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to