]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listbkg.cpp
Oops, forgot to cleanup some commented-out code before last commit.
[wxWidgets.git] / src / generic / listbkg.cpp
index 3e8d09d7fb1aa5b9427894f15d553ea20268d285..b82b9dde2f1d7827d9568465ec47533ef236a5d2 100644 (file)
@@ -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;