Recursive properties

One of the biggest pain of working with a lot of GUI libraries is the concept of recursive properties. When I set a parent’s property, does it propagate to the children or not? In cocos, this has been nicely fixed for things like alpha and color, but how about visibility?

I have a layer which contains a extension::TableView, and when I set the layer’s visibility to false, I expect the tableView to stop receiving touches, but it continues to receive touches, since only the parent’s property is changed.

How is this problem usually approached in cocos? Is it a bug?

On that note, I found this code in Menu class:

for (Node *c = this->_parent; c != nullptr; c = c->getParent())
{
    if (c->isVisible() == false)
    {
        return false;
    }
}

Does anyone else think it should be ported to TableView class?

Hi, just consider it as a question… !!

For the definitions under the TableView, have you added those as child to the parent through the object ?

like is there anything like we do for a sprite in a scene in here. ?
this->addChild()

i think to reflect the changes made to the child as changes happen in parent
you have to use the addChild()
if there is something missing, add it

Thanks, yeah, I am adding the TableView as a child, that’s how it is rendered in the scene :slight_smile: It also disappears when the parent is set to invisible.