Quoting from the Mac/Carbon/Mdi.cpp:
Code: Select all
void wxMDIParentFrame::AddChild(wxWindowBase *child)
{
if ( !m_currentChild )
{
m_currentChild = wxDynamicCast(child, wxMDIChildFrame);
if ( m_currentChild && IsShown() && !ShouldBeVisible() )
{
// we shouldn't remain visible any more
wxFrame::Show(false);
m_shouldBeShown = true;
}
}
wxFrame::AddChild(child);
}
When it is hidden, for some reason it gets an activate event which causes it to activate the currentChild. But the currentChild's activates relies on having it's parent set.
As you can see from the code this happens only at the end of the function.
Eventually I crash on the activate code.
I copied most of my code form the MDI sample with a small modification.
Can anyone help with this? Is this a bug?
Yaron Tadmor