]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcclient.cpp
added wxScrollWinEvent
[wxWidgets.git] / src / gtk / dcclient.cpp
index ffd5d9ef1539db6c9fdea3e8fc24169ef185bd8f..a5ee2b008c76b60c2cf83a53dcf32feb598b9518 100644 (file)
@@ -109,10 +109,24 @@ wxWindowDC::wxWindowDC( wxWindow *window )
     m_owner = (wxWindow *)NULL;
   
     if (!window) return;
+    
     GtkWidget *widget = window->m_wxwindow;
-    if (!widget) return;
+    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
@@ -618,13 +632,13 @@ bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
        {
           /* we HAVE TO use the direct way for memory dcs
              that have mask since the XCopyArea doesn't know
-             about masks and */
+             about masks */
            use_bitmap_method = TRUE;
        }
        else if (memDC->m_selected.GetDepth() == 1)
        {
           /* we HAVE TO use the direct way for memory dcs
-             that are bitmaps because XCopyArea doesn't copy
+             that are bitmaps because XCopyArea doesn't cope
              with different bit depths */
            use_bitmap_method = TRUE;
        }