GTK+ selects the first item initially, II

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-09-19 13:55:24 +00:00
parent 1d5a4d441b
commit 261a9107f0

View File

@@ -163,6 +163,12 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items,
m_selection_hack += count;
}
// We must set the selection so that it can be read back even if
// the user has not modified it since GTK+ will then select the
// first item so well return 0.
if ((count > 0) && (m_selection_hack==wxNOT_FOUND))
m_selection_hack = 0;
return pos - 1;
}