]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't cause scroll events for position changes from SetScrollbars, broken in r67326.
authorPaul Cornett <paulcor@bullseye.com>
Fri, 1 Jul 2011 17:44:49 +0000 (17:44 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Fri, 1 Jul 2011 17:44:49 +0000 (17:44 +0000)
Fixes #13301

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/scrolwin.cpp

index 291b30a49dba29c0b9c7a0c8e31ba29d1d918f5b..2ce5843e923bf46d3e762bf595ff1f128e55f196 100644 (file)
@@ -31,15 +31,12 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
                                    int xPos, int yPos,
                                    bool noRefresh)
 {
+    // prevent programmatic position changes from causing scroll events
+    m_win->SetScrollPos(wxHORIZONTAL, xPos);
+    m_win->SetScrollPos(wxVERTICAL, yPos);
+
     base_type::SetScrollbars(
         pixelsPerUnitX, pixelsPerUnitY, noUnitsX, noUnitsY, xPos, yPos, noRefresh);
-
-    gtk_range_set_value(m_win->m_scrollBar[wxWindow::ScrollDir_Horz], m_xScrollPosition);
-    gtk_range_set_value(m_win->m_scrollBar[wxWindow::ScrollDir_Vert], m_yScrollPosition);
-    m_win->m_scrollPos[wxWindow::ScrollDir_Horz] =
-        gtk_range_get_value(m_win->m_scrollBar[wxWindow::ScrollDir_Horz]);
-    m_win->m_scrollPos[wxWindow::ScrollDir_Vert] =
-        gtk_range_get_value(m_win->m_scrollBar[wxWindow::ScrollDir_Vert]);
 }
 
 void wxScrollHelper::DoAdjustScrollbar(GtkRange* range,