MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / CachingImageList

Class CachingImageList

gui/cachingImageList.py:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26class CachingImageList(wx.ImageList):
27 def __init__(self, width, height):
28 wx.ImageList.__init__(self, width, height)
29 self.map = {}
30
31 def GetImageIndex(self, *loaderArgs):
32 id_ = self.map.get(loaderArgs)
33 if id_ is None:
34 bitmap = BitmapLoader.getBitmap(*loaderArgs)
35 if bitmap is None:
36 return -1
37 id_ = self.map[loaderArgs] = wx.ImageList.Add(self, bitmap)
38 return id_

Callers 2

__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected