X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d5a4d441bb424320db2644b30c19b7c5bb0c234..1f9f790f56bc7d6fede09f95b3fb7655f80ed149:/src/gtk/choice.cpp diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index b63c3c68bc..2e160d2287 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -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; }