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:
@@ -163,6 +163,12 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items,
|
|||||||
m_selection_hack += count;
|
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;
|
return pos - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user