controls/LibraryPanel.py
branchwxPython4
changeset 3303 0ffb41625592
parent 2456 7373e3048167
child 3750 f62625418bff
--- a/controls/LibraryPanel.py	Thu Sep 02 21:36:29 2021 +0200
+++ b/controls/LibraryPanel.py	Thu Sep 02 22:18:14 2021 +0200
@@ -77,12 +77,12 @@
             search_textctrl = self.SearchCtrl.GetChildren()[0]
             search_textctrl.Bind(wx.EVT_CHAR, self.OnKeyDown)
 
-        main_sizer.AddWindow(self.SearchCtrl, flag=wx.GROW)
+        main_sizer.Add(self.SearchCtrl, flag=wx.GROW)
 
         # Add Splitter window for tree and block comment to main sizer
         splitter_window = wx.SplitterWindow(self)
         splitter_window.SetSashGravity(1.0)
-        main_sizer.AddWindow(splitter_window, flag=wx.GROW)
+        main_sizer.Add(splitter_window, flag=wx.GROW)
 
         # Add TreeCtrl for functions and function blocks library in splitter
         # window
@@ -216,7 +216,7 @@
 
                 # Set data associated to tree item (only save that item is a
                 # category)
-                self.Tree.SetPyData(category_item, {"type": CATEGORY})
+                self.Tree.SetItemData(category_item, {"type": CATEGORY})
 
                 # Iterate over functions and function blocks defined in library
                 # category add a tree item to category tree item for each of
@@ -253,7 +253,7 @@
                                        if blocktype["extensible"] else None),
                         "comment":    _(comment) + blocktype.get("usage", "")
                     }
-                    self.Tree.SetPyData(blocktype_item, block_data)
+                    self.Tree.SetItemData(blocktype_item, block_data)
 
                     # Select block tree item in tree if it corresponds to
                     # previously selected one