]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow app to call SetWindowVariant before creation of control
authorJulian Smart <julian@anthemion.co.uk>
Fri, 2 Apr 2004 15:57:31 +0000 (15:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 2 Apr 2004 15:57:31 +0000 (15:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index b42ab7d15ce96c8146664801c991b70a83ea75a2..fef61c1184773dbff01681c101051182edd91eed 100644 (file)
@@ -650,9 +650,14 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size)
 
 void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant )
 {
 
 void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant )
 {
-    wxASSERT( m_macControl != NULL ) ;
+    // Don't assert, in case we set the window variant before
+    // the window is created
+    // wxASSERT( m_macControl != NULL ) ;
+
+    m_windowVariant = variant ;
 
 
-    m_windowVariant = variant ; 
+    if (!m_macControl)
+        return;
 
        ControlSize size ;
     ThemeFontID themeFont = kThemeSystemFont ;
 
        ControlSize size ;
     ThemeFontID themeFont = kThemeSystemFont ;