Use CachingImageList.GetImageIndex for bitmaps that resides on FS, let wx.ImageList.Add deal with the rest (memory bitmaps)

This commit is contained in:
HomeWorld
2010-12-07 14:19:25 +02:00
parent 3979413a1d
commit 8e3fd63225
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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