The listbox showed its last, not first, item after creation in wxOSX which was
inconsistent with the other ports and generally inconvenient.
Fix this by ensuring that the first item being inserted is shown, and not the
last one as was (implicitly) the case before. A better fix would be to avoid
scrolling entirely but I don't know how to do this with NSClipView.
Closes #12365.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66038
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
GetListPeer()->UpdateLineToEnd(startpos);
+ // Inserting the items may scroll the listbox down to show the last
+ // selected one but we don't want to do it as it could result in e.g. the
+ // first items of a listbox be hidden immediately after its creation so
+ // show the first selected item instead. Ideal would probably be to
+ // preserve the old selection unchanged, in fact, but I don't know how to
+ // get the first visible item so for now do at least this.
+ SetFirstItem(startpos);
+
UpdateOldSelections();
return idx;