X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a9092ede82057123a4fe4c5f758782a8c21b3728..16190e2a113ec876cf6fedc507c5ee7c39714f43:/src/generic/listbkg.cpp?ds=sidebyside 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;