diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index dfd6c5d691..4208618f55 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1356,15 +1356,15 @@ void wxListMainWindow::MoveToFocus( void ) { int y_s = m_yScroll*GetScrollPos( wxVERTICAL ); if ((y > y_s) && (y+h < y_s+h_p)) return; - if (y-y_s < 5) Scroll( -1, (y-5-h_p/2)/m_yScroll ); - if (y+h+5 > y_s+h_p) Scroll( -1, (y+h-h_p/2+h+15)/m_yScroll ); + if (y-y_s < 5) { Scroll( -1, (y-5-h_p/2)/m_yScroll ); Refresh(); } + if (y+h+5 > y_s+h_p) { Scroll( -1, (y+h-h_p/2+h+15)/m_yScroll); Refresh(); } } else { int x_s = m_xScroll*GetScrollPos( wxHORIZONTAL ); if ((x > x_s) && (x+w < x_s+w_p)) return; - if (x-x_s < 5) Scroll( (x-5)/m_xScroll, -1 ); - if (x+w-5 > x_s+w_p) Scroll( (x+w-w_p+15)/m_xScroll, -1 ); + if (x-x_s < 5) { Scroll( (x-5)/m_xScroll, -1 ); Refresh(); } + if (x+w-5 > x_s+w_p) { Scroll( (x+w-w_p+15)/m_xScroll, -1 ); Refresh(); } } } diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index 139f45ed39..acce71b175 100644 --- a/src/generic/scrolwin.cpp +++ b/src/generic/scrolwin.cpp @@ -456,7 +456,8 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos ) SetScrollPos( wxVERTICAL, m_yScrollPosition, TRUE ); } - Refresh(); + // BAD, BAD, can cause event loops if called from OnPaint(). (KB) + // Refresh(); #ifdef __WXMSW__ // Necessary?