X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7f17ac744deb4cb8162d89d487afd1de8b66ce40..5f5f809d57694ccca5c80245f98fe05170962194:/src/mac/carbon/window.cpp?ds=sidebyside diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index c84a5c1632..8d5f618255 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -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() ); @@ -1869,11 +1868,14 @@ bool wxWindowMac::Show(bool show) return FALSE; // TODO use visibilityChanged Carbon Event for OSX - bool former = MacIsReallyShown() ; + if ( m_peer ) + { + bool former = MacIsReallyShown() ; - m_peer->SetVisibility( show , true ) ; - if ( former != MacIsReallyShown() ) - MacPropagateVisibilityChanged() ; + m_peer->SetVisibility( show , true ) ; + if ( former != MacIsReallyShown() ) + MacPropagateVisibilityChanged() ; + } return TRUE; } @@ -2486,7 +2488,7 @@ void wxWindowMac::MacOnScroll(wxScrollEvent &event ) } // Get the window with the focus -wxWindowMac *wxWindowBase::FindFocus() +wxWindowMac *wxWindowBase::DoFindFocus() { ControlRef control ; GetKeyboardFocus( GetUserFocusWindow() , &control ) ;