mirror of
https://github.com/RGBCube/serenity
synced 2025-07-06 21:27:36 +00:00
CObject: add_child() should set the child's parent.
This commit is contained in:
parent
b7cd6dea13
commit
dd299fe51a
1 changed files with 3 additions and 0 deletions
|
@ -43,6 +43,9 @@ void CObject::event(CEvent& event)
|
||||||
|
|
||||||
void CObject::add_child(CObject& object)
|
void CObject::add_child(CObject& object)
|
||||||
{
|
{
|
||||||
|
// FIXME: Should we support reparenting objects?
|
||||||
|
ASSERT(!object.parent() || object.parent() == this);
|
||||||
|
object.m_parent = this;
|
||||||
m_children.append(&object);
|
m_children.append(&object);
|
||||||
event(*make<CChildEvent>(CEvent::ChildAdded, object));
|
event(*make<CChildEvent>(CEvent::ChildAdded, object));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue