+bool wxNonOwnedWindow::Create(wxWindow *parent, WXWindow nativeWindow)
+{
+ if ( parent )
+ parent->AddChild(this);
+
+ SubclassWin(nativeWindow);
+
+ return true;
+}
+
+void wxNonOwnedWindow::SubclassWin(WXWindow nativeWindow)
+{
+ wxASSERT_MSG( !m_isNativeWindowWrapper, wxT("subclassing window twice?") );
+ wxASSERT_MSG( m_nowpeer == NULL, wxT("window already was created") );
+
+ m_nowpeer = wxNonOwnedWindowImpl::CreateNonOwnedWindow(this, GetParent(), nativeWindow );
+ m_isNativeWindowWrapper = true;
+ wxNonOwnedWindowImpl::Associate( m_nowpeer->GetWXWindow() , m_nowpeer ) ;
+ SetPeer(wxWidgetImpl::CreateContentView(this));
+}
+
+void wxNonOwnedWindow::UnsubclassWin()
+{
+ wxASSERT_MSG( m_isNativeWindowWrapper, wxT("window was not subclassed") );
+
+ if ( GetParent() )
+ GetParent()->RemoveChild(this);
+
+ wxNonOwnedWindowImpl::RemoveAssociations(m_nowpeer) ;
+ wxDELETE(m_nowpeer);
+ SetPeer(NULL);
+ m_isNativeWindowWrapper = false;
+}
+
+