'Attach' hooks are now called after the complete tree of children of the BView to be added is completely known by app_server
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11453 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a1ce489220
commit
0eed276cf7
@ -3198,6 +3198,7 @@ BView::AddChild(BView *child, BView *before)
|
||||
|
||||
child->setOwner(this->owner);
|
||||
attachView(child);
|
||||
callAttachHooks(child);
|
||||
|
||||
if (lockedByAddChild)
|
||||
owner->Unlock();
|
||||
@ -3733,26 +3734,18 @@ BView::removeSelf()
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
void
|
||||
BView::callDetachHooks(BView *aView)
|
||||
{
|
||||
// check_clock();
|
||||
|
||||
// call the hook function:
|
||||
aView->DetachedFromWindow();
|
||||
|
||||
// we attach all its children
|
||||
|
||||
BView *child = aView->first_child;
|
||||
while (child != NULL) {
|
||||
aView->callDetachHooks(child);
|
||||
child = child->next_sibling;
|
||||
}
|
||||
|
||||
// call the hook function:
|
||||
aView->AllDetached();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -3819,6 +3812,19 @@ BView::addToList(BView *aView, BView *before)
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
BView::callAttachHooks(BView *aView)
|
||||
{
|
||||
aView->AttachedToWindow();
|
||||
|
||||
BView *child= aView->first_child;
|
||||
while (child != NULL) {
|
||||
aView->callAttachHooks(child);
|
||||
child = child->next_sibling;
|
||||
}
|
||||
|
||||
aView->AllAttached();
|
||||
}
|
||||
|
||||
bool
|
||||
BView::attachView(BView *aView)
|
||||
@ -3851,9 +3857,6 @@ BView::attachView(BView *aView)
|
||||
|
||||
aView->setCachedState();
|
||||
|
||||
// call the hook function:
|
||||
aView->AttachedToWindow();
|
||||
|
||||
// we attach all its children
|
||||
|
||||
BView *child= aView->first_child;
|
||||
@ -3862,8 +3865,6 @@ BView::attachView(BView *aView)
|
||||
child = child->next_sibling;
|
||||
}
|
||||
|
||||
// call the hook function:
|
||||
aView->AllAttached();
|
||||
owner->fLink->Flush();
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user