X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d5a4d441bb424320db2644b30c19b7c5bb0c234..5b0c31c300bc5cab3346afd38fb444a1c52a53ac:/src/gtk/choice.cpp?ds=sidebyside 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; }