Hello All,
I have a list of images (wxImg) which I want to add to a grid sizer. I
cannot figure it out how to add them. Here is my piece of code.
import wx
class MyPanel(wx.Panel):
def init(self, *args, **kwargs):
wx.Panel.init(self, *args, **kwargs)
msz = wx.BoxSizer(wx.VERTICAL)
gs = wx.GridSizer(5, 5, 0, 0)
self.ic = []
for i in range(len(wxImg)):
self.ic.append(wx.StaticBitmap(self, wx.ID_ANY,
wx.BitmapFromImage(wxImg[i]),
name=“Pic” + str(i + 1))
gs.Add(self.ic[i], 0, wx.ALIGN_LEFT)
self.ic[i].Bind(wx.EVT_LEFT_DOWN, self.OnClick)
msz.Add(gs, 0, wx.ALL, 5)
self.SetSizer(msz)
and so on. It always gives me error.
Please help.
Thanks.