From: Robert Roebling Date: Wed, 30 Jan 2002 15:26:49 +0000 (+0000) Subject: New Refresh()/Update() behaviour. As expected, scrolling X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/23716407e18470ab32c0b52cb6bcff751f679476 New Refresh()/Update() behaviour. As expected, scrolling messes up the display. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 784407129e..e7da1dd4e7 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3365,14 +3365,18 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) { if (m_wxwindow) { - -/* +#if 0 GtkPizza *pizza = GTK_PIZZA(m_wxwindow); gboolean old_clear = pizza->clear_on_draw; gtk_pizza_set_clear( pizza, FALSE ); gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL ); gtk_pizza_set_clear( pizza, old_clear ); -*/ +#endif + +#if 1 + // Schedule for later Updating in ::Update() or ::OnInternalIdle(). + m_updateRegion.Union( 0, 0, m_wxwindow->allocation.width, m_wxwindow->allocation.height ); +#else GdkEventExpose gdk_event; gdk_event.type = GDK_EXPOSE; gdk_event.window = GTK_PIZZA(m_wxwindow)->bin_window; @@ -3382,6 +3386,7 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) gdk_event.area.width = m_wxwindow->allocation.width; gdk_event.area.height = m_wxwindow->allocation.height; gtk_window_expose_callback( m_wxwindow, &gdk_event, (wxWindow *)this ); +#endif } else { @@ -3393,7 +3398,7 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) if (m_wxwindow) { -/* +#if 0 GtkPizza *pizza = GTK_PIZZA(m_wxwindow); gboolean old_clear = pizza->clear_on_draw; gtk_pizza_set_clear( pizza, FALSE ); @@ -3407,7 +3412,12 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) gtk_window_draw_callback( m_wxwindow, &gdk_rect, this ); gtk_pizza_set_clear( pizza, old_clear ); -*/ +#endif + +#if 1 + // Schedule for later Updating in ::Update() or ::OnInternalIdle(). + m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height ); +#else GdkEventExpose gdk_event; gdk_event.type = GDK_EXPOSE; gdk_event.window = GTK_PIZZA(m_wxwindow)->bin_window; @@ -3417,6 +3427,7 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) gdk_event.area.width = rect->width; gdk_event.area.height = rect->height; gtk_window_expose_callback( m_wxwindow, &gdk_event, (wxWindow *)this ); +#endif } else { @@ -3434,7 +3445,7 @@ void wxWindowGTK::Update() { if (!m_updateRegion.IsEmpty()) { - printf( "never gets called\n" ); + GtkSendPaintEvents(); } } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 784407129e..e7da1dd4e7 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -3365,14 +3365,18 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) { if (m_wxwindow) { - -/* +#if 0 GtkPizza *pizza = GTK_PIZZA(m_wxwindow); gboolean old_clear = pizza->clear_on_draw; gtk_pizza_set_clear( pizza, FALSE ); gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL ); gtk_pizza_set_clear( pizza, old_clear ); -*/ +#endif + +#if 1 + // Schedule for later Updating in ::Update() or ::OnInternalIdle(). + m_updateRegion.Union( 0, 0, m_wxwindow->allocation.width, m_wxwindow->allocation.height ); +#else GdkEventExpose gdk_event; gdk_event.type = GDK_EXPOSE; gdk_event.window = GTK_PIZZA(m_wxwindow)->bin_window; @@ -3382,6 +3386,7 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) gdk_event.area.width = m_wxwindow->allocation.width; gdk_event.area.height = m_wxwindow->allocation.height; gtk_window_expose_callback( m_wxwindow, &gdk_event, (wxWindow *)this ); +#endif } else { @@ -3393,7 +3398,7 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) if (m_wxwindow) { -/* +#if 0 GtkPizza *pizza = GTK_PIZZA(m_wxwindow); gboolean old_clear = pizza->clear_on_draw; gtk_pizza_set_clear( pizza, FALSE ); @@ -3407,7 +3412,12 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) gtk_window_draw_callback( m_wxwindow, &gdk_rect, this ); gtk_pizza_set_clear( pizza, old_clear ); -*/ +#endif + +#if 1 + // Schedule for later Updating in ::Update() or ::OnInternalIdle(). + m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height ); +#else GdkEventExpose gdk_event; gdk_event.type = GDK_EXPOSE; gdk_event.window = GTK_PIZZA(m_wxwindow)->bin_window; @@ -3417,6 +3427,7 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) gdk_event.area.width = rect->width; gdk_event.area.height = rect->height; gtk_window_expose_callback( m_wxwindow, &gdk_event, (wxWindow *)this ); +#endif } else { @@ -3434,7 +3445,7 @@ void wxWindowGTK::Update() { if (!m_updateRegion.IsEmpty()) { - printf( "never gets called\n" ); + GtkSendPaintEvents(); } }