Progress (details of the use of names and groups):

You can target a nested group by simply specifying one of it's owners (you
don't need the whole hierarchy). Therefore to fix the problem that occurs
when are two objects with the same name inside different groups:

  put "Test" into fld "Title" of group "Write"

works even if there is another field "Title" in group "Read". This works
even when fl "Title" is in fact inside another group and then inside the
group "Write" - you don't need to specify all the nesting in order to safely
specify the field - which is nice.

I now use syntax like this

  put topGroupId() into myGroupId
  put "Working" into fld "Write Subject" of group id myGroupId
  -- put "Error" into fld "Write Subject" -- would go into the wrong field

I can then place a function in the top group that I want to be able to clone
and place wherever I want, and not have to worry about the names of other
objects on the card.

The following function in the script of the top groups object then
identifies the group, allowing it to act as an independent object:

function topGroupId
  return the short id of me
end topGroupId

 

> From: David Bovill <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Thu, 07 Sep 2000 12:08:25 +0100
> To: [EMAIL PROTECTED]
> Subject: Using groups - geometry management
> 
> 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.
> 
> 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?
> 
> 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.
> 
> Ta
> 
> 
> 
> 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.


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