Contents Up Previous Next

OnClose

The old virtual function OnClose is now obsolete. Add an OnCloseWindow event handler using an EVT_CLOSE event table entry. For details about window destruction, see the Windows Deletion Overview in the manual. This is a subtle topic so please read it very carefully. Basically, OnCloseWindow is now responsible for destroying a window with Destroy(), but the default implementation (for example for wxDialog) may not destroy the window, so to be sure, always provide this event handler so it's obvious what's going on.