]> git.saurik.com Git - wxWidgets.git/commitdiff
call AddChild() when the control is already reallly created
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 16 Oct 2004 15:00:40 +0000 (15:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 16 Oct 2004 15:00:40 +0000 (15:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index 06d75e461139b50163649fe4a33a65a48ea9ef0f..f33b1a2a3d2ed8deef1425bd7e4c15eabe555f2f 100644 (file)
@@ -810,8 +810,6 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id,
     if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
         return FALSE;
 
-    parent->AddChild(this);
-
     m_windowVariant = parent->GetWindowVariant() ;
 
     if ( m_macIsUserPane )
@@ -865,6 +863,7 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size)
     wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid mac control") ) ;
 
     m_peer->SetReference( (long) this ) ;
+    GetParent()->AddChild(this);
 
     MacInstallEventHandler( (WXWidget) m_peer->GetControlRef() );