if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE;
- parent->AddChild(this);
-
m_windowVariant = parent->GetWindowVariant() ;
if ( m_macIsUserPane )
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() );
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;
}