From 2437f26ca50fae0c76d3dddc85b0356755dda9fb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 Apr 2004 22:15:52 +0000 Subject: [PATCH] fixed bug with SetSelection() not hiding the previously shown page git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listbkg.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index 3e8d09d7fb..b82b9dde2f 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -357,10 +357,12 @@ int wxListbook::SetSelection(size_t n) if ( (int)n != m_selection ) { - m_selection = n; + m_list->Select(n); + m_list->Focus(n); - m_list->Select(m_selection); - m_list->Focus(m_selection); + // change m_selection only now, otherwise OnListSelected() would ignore + // the selection change event + m_selection = n; } return selOld; -- 2.50.0