API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
- IDrawDecorator Interface - IContainer Interface - IDrawDecorator_GetParent() - IDecorator_SetParent() - IWidget_SetParent()
This function allows a container to identify itself as the parent of a draw decorator, or remove the draw decorator as one of its children. Objects within the widget framework maintain a hierarchy of parent/child relationships, wherein a container may enclose and manage one or more child objects. The children of a parent container may be widgets, or additional containers and decorators, with each child receiving events and being managed by its parent.
IDrawDecorator_SetParent() inherits wholly from IDecorator_SetParent().
Pointer to the IDrawDecorator object.
Pointer to the IContainer object that will act as the draw decorator's parent, or NULL if the draw decorator is being orphaned.
  •    void IDrawDecorator_SetParent(IDrawDecorator *p, IContainer *c);
  • none
Side Effect
  • None
Removing a parent/child relationship by passing NULL as a draw decorator's parent in the 'c' field does NOT move the object up one level in the object hierarchy. In other words, if an object is the grandchild of a container and the object's parent is removed, the object does NOT become a child of the grandparent. IDrawDecorator_SetParent() should only be called by a container that is managing the draw decorator. Draw decorators must not refcount their parents. It is the parent's responsibility to set the parent pointer of all child objects to NULL prior to the parent being deleted.