PLCOpenEditor.py
changeset 245 fdd05081c966
parent 241 64e584348a5b
child 249 d8425712acef
equal deleted inserted replaced
244:05f6e0d7710c 245:fdd05081c966
  1682 #-------------------------------------------------------------------------------
  1682 #-------------------------------------------------------------------------------
  1683 
  1683 
  1684     def RefreshLibraryTree(self):
  1684     def RefreshLibraryTree(self):
  1685         to_delete = []
  1685         to_delete = []
  1686         blocktypes = self.Controler.GetBlockTypes()
  1686         blocktypes = self.Controler.GetBlockTypes()
  1687         if wx.Platform == '__WXMSW__':
  1687         root = self.LibraryTree.GetRootItem()
  1688             root = self.LibraryTree.AddRoot("Block Types")
  1688         if not root.IsOk():
  1689             self.LibraryTree.SetPyData(root, {"type" : CATEGORY})
  1689             if wx.Platform == '__WXMSW__':
  1690         else:
  1690                 root = self.LibraryTree.AddRoot("Block Types")
  1691             root = self.LibraryTree.AddRoot("")
  1691                 self.LibraryTree.SetPyData(root, {"type" : CATEGORY})
       
  1692             else:
       
  1693                 root = self.LibraryTree.AddRoot("")
  1692         if wx.VERSION >= (2, 6, 0):
  1694         if wx.VERSION >= (2, 6, 0):
  1693             category_item, root_cookie = self.LibraryTree.GetFirstChild(root)
  1695             category_item, root_cookie = self.LibraryTree.GetFirstChild(root)
  1694         else:
  1696         else:
  1695             category_item, root_cookie = self.LibraryTree.GetFirstChild(root, 0)
  1697             category_item, root_cookie = self.LibraryTree.GetFirstChild(root, 0)
  1696         for category in blocktypes:
  1698         for category in blocktypes: