]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/nonownedwnd.cpp
wxRichTextCtrl native caret now flashes, for wxMac/Core Graphics mode
[wxWidgets.git] / src / osx / carbon / nonownedwnd.cpp
index 179f6b49971dbaf333682f0c2da18752febd6b62..cbacef05122a7ec1d0ac9499f3fa416d439da752 100644 (file)
@@ -99,12 +99,18 @@ bool wxNonOwnedWindowCarbonImpl::SetBackgroundColour(const wxColour& col )
     if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) )
     {
         SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDocumentWindowBackground, false ) ;
-        SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        m_wxPeer->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        // call directly if object is not yet completely constructed
+        if ( m_wxPeer->GetNonOwnedPeer() == NULL )
+            SetBackgroundStyle(wxBG_STYLE_SYSTEM);
     }
     else if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) )
     {
         SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDialogBackgroundActive, false ) ;
-        SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        m_wxPeer->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        // call directly if object is not yet completely constructed
+        if ( m_wxPeer->GetNonOwnedPeer() == NULL )
+            SetBackgroundStyle(wxBG_STYLE_SYSTEM);
     }
     return true;
 }