I am trying a add around 1,500 bitmaps to a ScrolledWindow, inside a GridSizer. They are loaded successfully (but a bit slow).
My issue is: whenever I scroll a bit faster, the whole thing freezes for 8-10 seconds.
Here is the relevant code:
class EmojiDBTab(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent)
self.SetScrollbars(1, 10, 1, 10)
dbtab_sizer = wx.GridSizer(len(TEST_UNICODE_EMOJI) / 10 + 1, 10, 0, 0)
for unicode in TEST_UNICODE_EMOJI:
emoji_symbol = EmojiBitmap(wx.Bitmap(unicode_to_pngfilename(unicode)),
TEST_UNICODE_EMOJI[unicode])
dbtab_sizer.Add(wx.StaticBitmap(self, -1, emoji_symbol.bitmap))
self.SetSizer(dbtab_sizer)
Is there a way to avoid the big delay after scrolling?
Thanks!