#1867 Fix for the image list crash on linux
This commit is contained in:
@@ -62,6 +62,8 @@ class ItemParams(wx.Panel):
|
||||
|
||||
mainSizer.Add(bSizer, 0, wx.ALIGN_RIGHT)
|
||||
|
||||
self.imageList = wx.ImageList(16, 16)
|
||||
|
||||
self.PopulateList()
|
||||
|
||||
self.toggleViewBtn.Bind(wx.EVT_TOGGLEBUTTON, self.ToggleViewMode)
|
||||
@@ -164,6 +166,14 @@ class ItemParams(wx.Panel):
|
||||
]
|
||||
)
|
||||
|
||||
def SetupImageList(self):
|
||||
self.imageList.RemoveAll()
|
||||
|
||||
self.blank_icon = self.imageList.Add(BitmapLoader.getBitmap("transparent16x16", "gui"))
|
||||
self.unknown_icon = self.imageList.Add(BitmapLoader.getBitmap("0", "icons"))
|
||||
|
||||
self.paramList.AssignImageList(self.imageList)
|
||||
|
||||
def AddAttribute(self, parent, attr):
|
||||
if attr in self.attrValues and attr not in self.processed_attribs:
|
||||
|
||||
@@ -188,7 +198,7 @@ class ItemParams(wx.Panel):
|
||||
|
||||
def PopulateList(self):
|
||||
# self.paramList.setResizeColumn(0)
|
||||
self.imageList = wx.ImageList(16, 16)
|
||||
self.SetupImageList()
|
||||
|
||||
self.processed_attribs = set()
|
||||
root = self.paramList.AddRoot("The Root Item")
|
||||
@@ -243,7 +253,6 @@ class ItemParams(wx.Panel):
|
||||
|
||||
self.AddAttribute(root, name)
|
||||
|
||||
self.paramList.AssignImageList(self.imageList)
|
||||
self.Layout()
|
||||
|
||||
def GetData(self, attr):
|
||||
@@ -278,13 +287,13 @@ class ItemParams(wx.Panel):
|
||||
icon = BitmapLoader.getBitmap(iconFile, "icons")
|
||||
|
||||
if icon is None:
|
||||
icon = BitmapLoader.getBitmap("transparent16x16", "gui")
|
||||
|
||||
attrIcon = self.imageList.Add(icon)
|
||||
attrIcon = self.blank_icon
|
||||
else:
|
||||
attrIcon = self.imageList.Add(icon)
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("0", "icons"))
|
||||
attrIcon = self.unknown_icon
|
||||
else:
|
||||
attrIcon = self.imageList.Add(BitmapLoader.getBitmap("0", "icons"))
|
||||
attrIcon = self.unknown_icon
|
||||
|
||||
# index = self.paramList.AppendItem(root, attrName)
|
||||
# idNameMap[idCount] = attrName
|
||||
|
||||
Reference in New Issue
Block a user