Page 1 of 1
Getting the "owner" of a control
Posted: Thu Aug 06, 2009 7:37 pm
by phaworth
I have a need to to find out whether an object on a card is part of a group or placed directly on the card, and then to get the name of the group or card. If the object is in a group, I would have to allow for the fact that the group may be part of another group.
Is there a way to traverse the hierarchy of objects that an object belongs to?
Thanks,
Pete
Posted: Thu Aug 06, 2009 7:42 pm
by Klaus
Hi Pete,
you won't believe it, but check "owner" in the docs (Revolution Dictionary)
Best
Klaus
Posted: Thu Aug 06, 2009 7:47 pm
by phaworth
Thanks Klaus!!! I guess RTFM should be my mantra!
I guess I may be missing this but is there a place in any of the documentation where you can list all the properties and messages related to a particular type of object? In other words, I search,eg, for "Field" and get a list of all the messages/properties associated with any field object.
Thanks,
Pete
Posted: Thu Aug 06, 2009 8:26 pm
by Klaus
Hi Pete,
well, on the left side of the "Rev Dictionary" there is a "tree" list field which lists all Rev objects (and more) and when clicked will show all the props for this kind of object.
I think this is since version 3 (?).
Best
Klaus
Posted: Fri Aug 14, 2009 9:55 pm
by phaworth
OK, so now I'm looking for the reverse of the above. For example, given a group name/id, how do I get a list of all the objects that are in that group? Right now, I'm going through every object on the card and checking its owner, but hoping there's a more efficient way to do it.
Thanks,
Pete
Posted: Sat Aug 15, 2009 11:02 am
by Klaus
Hi Pete,
in that case it is even easier:
...
put the num of controls of grp "Your geoup here" into xyz
...
put the num of buttons of grp ...
...
put the num of fields of grp ...
...
etc.
No need to check the owner if you knwo the name/number/ID of the group!
Best
Klaus
Posted: Sat Aug 15, 2009 2:36 pm
by Mark
Dear Pete,
You might want to check the two handlers available at
http://runrev.info/Objects%20list.htm . These two getProp handlers return a list of controls of any group, card or stack. Just use the syntax
Code: Select all
put the objects of group 1 into myObjects1
put the objects of this stack into myObjects2
Best,
Mark
Posted: Sat Aug 15, 2009 5:03 pm
by phaworth
Thanks Mark, Looks like that will do the job.
Pete