]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/nonownedwnd_osx.cpp
Fix bug with using uninitialized flags in GetParentForModalDialog().
[wxWidgets.git] / src / osx / nonownedwnd_osx.cpp
index a75e778ba84bc62f3bb3f098ddb6b4c107b40324..741b6468776c7d8ef54faa642f7191d8c93a34c8 100644 (file)
@@ -98,6 +98,7 @@ wxNonOwnedWindow *wxNonOwnedWindow::s_macDeactivateWindow = NULL;
 void wxNonOwnedWindow::Init()
 {
     m_nowpeer = NULL;
+    m_isNativeWindowWrapper = false;
 }
 
 bool wxNonOwnedWindow::Create(wxWindow *parent,
@@ -107,9 +108,6 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
                                  long style,
                                  const wxString& name)
 {
-    // init our fields
-    Init();
-
     m_windowStyle = style;
 
     SetName( name );
@@ -150,6 +148,19 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
     return true;
 }
 
+bool wxNonOwnedWindow::Create(wxWindow *parent, WXWindow nativeWindow)
+{
+    m_nowpeer = wxNonOwnedWindowImpl::CreateNonOwnedWindow(this, parent, nativeWindow );
+    m_isNativeWindowWrapper = true;
+    wxAssociateWindowWithWXWindow( m_nowpeer->GetWXWindow() , this ) ;
+    m_peer = wxWidgetImpl::CreateContentView(this);
+
+    if ( parent )
+        parent->AddChild(this);
+    
+    return true;
+}
+
 wxNonOwnedWindow::~wxNonOwnedWindow()
 {
     SendDestroyEvent();