Developer

API Reference

IDrawDecorator_SetParent()

Brew Release
Brew MP 1.0.2
See Also
- IDrawDecorator Interface
- IContainer Interface
- IDrawDecorator_GetParent()
- IDecorator_SetParent()
- IWidget_SetParent()
Description
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().
Parameters
  • p
    []:
    Pointer to the IDrawDecorator object.
  • c
    []:
    Pointer to the IContainer object that will act as the draw decorator's parent, or NULL if the draw decorator is being orphaned.
Prototype
   void IDrawDecorator_SetParent(IDrawDecorator *p, IContainer *c);
   
Return
none
Side Effect
None
Comment
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.
  • Follow