IDE: fix exception when removing a file in Project Files manager. wxPython4
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 19 Oct 2022 22:04:39 +0200
branchwxPython4
changeset 3636 99b20dff00d5
parent 3635 5107a2712b17
child 3637 08a078a04f95
IDE: fix exception when removing a file in Project Files manager.
controls/FolderTree.py
--- a/controls/FolderTree.py	Wed Oct 19 20:53:01 2022 +0200
+++ b/controls/FolderTree.py	Wed Oct 19 22:04:39 2022 +0200
@@ -160,7 +160,7 @@
                 if wx.Platform != '__WXMSW__':
                     item, item_cookie = self.Tree.GetNextChild(root, item_cookie)
             elif self.Tree.GetItemText(item) != filename:
-                item = self.Tree.InsertItemBefore(root, idx, filename, self.TreeImageDict[item_type])
+                item = self.Tree.InsertItem(root, idx, filename, self.TreeImageDict[item_type])
             filepath = os.path.join(folderpath, filename)
             if item_type != FILE:
                 if self.Tree.IsExpanded(item):