]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcclient.cpp
More for wxPython 2.0b9 (hopefully the last...)
[wxWidgets.git] / src / gtk / dcclient.cpp
index ffd5d9ef1539db6c9fdea3e8fc24169ef185bd8f..918e0a52db4ae3223bd9f6d1239365471579c362 100644 (file)
@@ -109,10 +109,23 @@ wxWindowDC::wxWindowDC( wxWindow *window )
     m_owner = (wxWindow *)NULL;
   
     if (!window) return;
+    
     GtkWidget *widget = window->m_wxwindow;
     if (!widget) return;
+    
     m_window = widget->window;
+    
+    /* not realized ? */
+    if (!m_window)
+    {
+         /* force realization */
+         gtk_widget_realize( widget );
+         m_window = widget->window;
+    }
+    
+    /* still not realized ? */
     if (!m_window) return;
+    
     if (window->m_wxwindow)
         m_cmap = gtk_widget_get_colormap( window->m_wxwindow );
     else