]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/window.cpp
Make use of new array functions.
[wxWidgets.git] / src / gtk1 / window.cpp
index ad3161a7d5e8228c3b9967f0cf14cf768a6771ec..30dfae29e094b9f9f9a2d24dbf7cc910a743a902 100644 (file)
@@ -497,6 +497,14 @@ static int gtk_window_expose_callback( GtkWidget *widget,
     if (g_isIdle)
         wxapp_install_idle_handler();
 
+#ifdef __WXGTK20__
+    // This callback gets called in drawing-idle time under
+    // GTK 2.0, so we don't need to defer anything to idle
+    // time anymore.
+    
+    GtkPizza *pizza = GTK_PIZZA( widget );
+    if (gdk_event->window != pizza->bin_window) return FALSE;
+    
 #if 0
     if (win->GetName())
     {
@@ -510,16 +518,11 @@ static int gtk_window_expose_callback( GtkWidget *widget,
     }
 #endif
 
-#ifdef __WXGTK20__
-    // This callback gets called in drawing-idle time under
-    // GTK 2.0, so we don't need to defer anything to idle
-    // time anymore.
-    
     win->GetUpdateRegion() = wxRegion( gdk_event->region );
 
     win->GtkSendPaintEvents();
 
-    // Draw window less widgets
+    // Let parent window draw window less widgets
     (* GTK_WIDGET_CLASS (pizza_parent_class)->expose_event) (widget, gdk_event);
 #else
     // This gets called immediately after an expose event
@@ -539,8 +542,7 @@ static int gtk_window_expose_callback( GtkWidget *widget,
     // win->GtkUpdate();
 #endif
 
-
-    return TRUE;
+    return FALSE;
 }
 
 //-----------------------------------------------------------------------------
@@ -1898,7 +1900,9 @@ static void gtk_window_vscroll_callback( GtkAdjustment *adjust,
 
     win->m_oldVerticalPos = adjust->value;
 
+#ifndef __WXGTK20__
     GtkScrolledWindow   *sw = GTK_SCROLLED_WINDOW(win->m_widget);
+#endif
     wxEventType         command = GtkScrollWinTypeToWx(GET_SCROLL_TYPE(sw->vscrollbar));
 
     int value = (int)(adjust->value+0.5);
@@ -1927,7 +1931,9 @@ static void gtk_window_hscroll_callback( GtkAdjustment *adjust,
     float diff = adjust->value - win->m_oldHorizontalPos;
     if (fabs(diff) < 0.2) return;
 
+#ifndef __WXGTK20__
     GtkScrolledWindow   *sw = GTK_SCROLLED_WINDOW(win->m_widget);
+#endif
     wxEventType         command = GtkScrollWinTypeToWx(GET_SCROLL_TYPE(sw->hscrollbar));
 
     win->m_oldHorizontalPos = adjust->value;
@@ -4261,20 +4267,13 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
         GetClientSize( &cw, &ch );
         m_clearRegion.Intersect( 0, 0, cw, ch );
     }
+#endif
+
     m_clipPaintRegion = TRUE;
 
     gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
 
     m_clipPaintRegion = FALSE;
-#else
-
-    gdk_window_scroll( GTK_PIZZA(m_wxwindow)->bin_window, dx, dy );
-
-    GTK_PIZZA(m_wxwindow)->xoffset += dx;
-    GTK_PIZZA(m_wxwindow)->yoffset += dy;
-
-#endif
-
 }