X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/385e8575dd1f9219fb0e3f7fa26ffe4c24d2fdbb..d3f81b85331b14943862a0c0df5ef8adb4426ad4:/src/gtk/scrolwin.cpp diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 291b30a49d..2ce5843e92 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -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,