OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Destroying Windows

Destroying a parent window also destroys all its child windows.

You do not need to explicitly destroy child windows or delete child window interface objects. The same is true for the TWindow::CanClose() mechanism; CanClose for a parent window calls CanClose for all its children. The parent's CanClose returns true only if all its children return true for CanClose.

When you destroy an object's interface element, it enables automatic creation for all its children, regardless of whether automatic creation was on or off before. This way, when you create the parent, all the children are restored in the state they were in before their parent was destroyed. You can use this technique to destroy an interface element, and then re-create it in the same state it was in when you destroyed it.

To prevent this behavior, you must explicitly turn off automatic creation for any child objects you do not want to have created automatically.

See Also