Originally Posted by
Leif0311
Why do you suggest to select the last item in the list?
This may conflict with the users selection before the list contents changed.
I would suggest to leave the current selection where it is as long as the selected item stays in the list.
The list object seems to rebuild the whole list and reset the selection to 0 each time an item is added.
Not sure if this could be changed and how complex that would be.
Not touching this code and just resetting the selection to whatever after the list rebuild finished sounds easy but may cause the next problem.
What happens if the user clicks the rezz button and the list is being rebuild at the same moment?
You will have two threads competing, one rebuilding the list and changing the selected index to 0 and back (or to the new last item) and another one sooner or later calling something like "getSelectedIndex".
If the two threads are not synchronized regarding setting/getting the selected index, you may still get index 0 by chance.