From 8386a0e6c7696d0d974e00c61e461a948022cae2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 5 Oct 2018 14:24:39 -0700 Subject: [PATCH] Use the position returned from InsertItem, in case the listctrl is sorted and the item is moved to some other location. --- etg/listctrl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/etg/listctrl.py b/etg/listctrl.py index 4e80deec..73404998 100644 --- a/etg/listctrl.py +++ b/etg/listctrl.py @@ -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