Cast custom container to Drawable*
I want to use container as Drawable*, so I can use methods like moveTo() etc. to move the container around.
I have my container in View, which is selectorboxContainer, which inherits from selectorboxContainerBase, which inherits from touchgfx::Container, which inheirts from Drawable.
I can get Drawable* to this object using this method:
Drawable* selectorbox = getFirstChild();
But I cannot do it like this:
Drawable* selectorbox = (Drawable*) selectorBox1;
I get error:
error: invalid cast from type 'selectorboxContainer' to type 'touchgfx::Drawable*'
Why getFirstChild() can cast my container to Drawable*, but I cannot do it by casting?
I don't want to use getFirstChild(), because it blindly picks Drawable based on order, instead of the drawable name. If someone reorders drawables, it will break the application.
