GNOME Bugzilla – Bug 547163
Can't call protected vfuncs of children.
Last modified: 2009-01-27 09:30:50 UTC
To implement a layout manager class, I need to write a class that inherits from clutter::actor and clutter:container, The idea is to write something similar to clutter:group, which contains other actors, and but unlike group that just calls do_paint one by one, It needs to make smarter choises and lay them out on the screen. My problem writing this class, is that i need to have several actor children, and call there virtual functions to get the info i need to lay them out, and also to paint them, for example, call there allocate_vfunc() to find there screen size, and make decisions according to that size. quote from clutter's allocate function "Should never be called by applications (except when implementing a container or layout manager)." I cannot do that, because all the virtual functions are protected, so I cannot call m_child[0]->allocate(), or any other vfuncs. I'm guessing they are protected because of "Should never be called by applications" , but as I am implementing the exception, I'm stuck. I'm not that familiar with the glib objects in C, I'm guessing they didnt implement 'protected' functionality, or they can somehow override that. Any suggestions/idea's on how to fix this?
Clutter::Actor::allocate() is not protected. I believe it's how you should invoke the Clutter::Actor::allocate_vfunc() virtual functions.
Have you had success with that?
Please respond.
Closing due to lack of response. See comment #1.