Use the position returned from InsertItem, in case the listctrl is sorted and the item is moved to some other location.

This commit is contained in:
Robin Dunn
2018-10-05 14:24:39 -07:00
parent cd3fcb308a
commit 8386a0e6c7

View File

@@ -310,8 +310,7 @@ def run():
body="""\
if len(entry):
from six import text_type
pos = self.GetItemCount()
self.InsertItem(pos, text_type(entry[0]))
pos = self.InsertItem(self.GetItemCount(), text_type(entry[0]))
for i in range(1, len(entry)):
self.SetItem(pos, i, text_type(entry[i]))
return pos