From 8e3fd63225bece0f492f950afbcb1bed88116ab4 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Tue, 7 Dec 2010 14:19:25 +0200 Subject: [PATCH] Use CachingImageList.GetImageIndex for bitmaps that resides on FS, let wx.ImageList.Add deal with the rest (memory bitmaps) --- gui/cachingImageList.py | 2 +- gui/marketBrowser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/cachingImageList.py b/gui/cachingImageList.py index 28a195352..904a2c4a8 100644 --- a/gui/cachingImageList.py +++ b/gui/cachingImageList.py @@ -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) diff --git a/gui/marketBrowser.py b/gui/marketBrowser.py index 42cc9ade7..0234f8911 100644 --- a/gui/marketBrowser.py +++ b/gui/marketBrowser.py @@ -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