Use CachingImageList.GetImageIndex for bitmaps that resides on FS, let wx.ImageList.Add deal with the rest (memory bitmaps)
This commit is contained in:
@@ -25,7 +25,7 @@ class CachingImageList(wx.ImageList):
|
||||
wx.ImageList.__init__(self, width, height)
|
||||
self.map = {}
|
||||
|
||||
def Add(self, *loaderArgs):
|
||||
def GetImageIndex(self, *loaderArgs):
|
||||
id = self.map.get(loaderArgs)
|
||||
if id is None:
|
||||
bitmap = bitmapLoader.getBitmap(*loaderArgs)
|
||||
|
||||
@@ -139,7 +139,7 @@ class MarketTree(wx.TreeCtrl):
|
||||
if iconFile is None:
|
||||
return -1
|
||||
|
||||
return self.imageList.Add(iconFile, "pack")
|
||||
return self.imageList.GetImageIndex(iconFile, "pack")
|
||||
|
||||
def expandLookup(self, event):
|
||||
root = event.Item
|
||||
|
||||
Reference in New Issue
Block a user