From: Vadim Zeitlin Date: Wed, 27 Oct 2010 23:22:11 +0000 (+0000) Subject: Fix list box unit test under wxGTK. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/24d7c81c3265d15d4ccf051782c93849462316fb Fix list box unit test under wxGTK. Select an item initially to prevent GTK from doing it automatically as soon as the listbox is clicked anywhere (even outside of the items area). This makes all GUI tests finally pass under wxGTK. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/controls/listboxtest.cpp b/tests/controls/listboxtest.cpp index 2accf43119..2a3121f0b4 100644 --- a/tests/controls/listboxtest.cpp +++ b/tests/controls/listboxtest.cpp @@ -226,6 +226,13 @@ void ListBoxTestCase::ClickNotOnItem() m_list->Append(testitems); + // It is important to set a valid selection: if the control doesn't have + // any, clicking anywhere in it, even outside of any item, selects the + // first item in the control under GTK resulting in a selection changed + // event. This is not a wx bug, just the native platform behaviour so + // simply avoid it by starting with a valid selection. + m_list->SetSelection(0); + m_list->Update(); m_list->Refresh();