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


API Reference


Brew Release
Brew MP 1.0.2
See Also
- IDecorator Interface - IContainer Interface - IDecorator_GetParent() - IWidget_SetParent()
This function allows a container to identify itself as the parent of a decorator, or remove the 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.
IDecorator_SetParent() inherits wholly from IWIDGET_SetParent().
[in] Pointer to the IDecorator object.
[in] Pointer to the IContainer object that will act as the decorator's parent, or NULL if the decorator is being orphaned.
  •    void IDecorator_SetParent(IDecorator *pif, IContainer *pwc);
  • none
Side Effect
  • None
Removing a parent/child relationship by passing NULL as a decorator's parent in the 'pwc' 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. IDecorator_SetParent() should only be called by a container that is managing the decorator. Decorator 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.