I have been trying to swap 2 pictures in a list. I am adding the list to a GridSizer of 1 row and 2 cols. I have one horizontal BoxSizer where I am adding the GridSizer along with a button upon which, when clicked, the pictures are supposed to be swapped. But I am getting type error string or unicode required. I am using Python 2.7.6 and wxPython 2.8.12.1 (gtk2-unicode) on a Linux Mint 64-bit laptop. Below is the part of my program where the error is occurring. Please help.
Thanks.
def OnOk(self, event):
x = wx.Image(self.ic[0], wx.BITMAP_TYPE_ANY).Scale(200, 200)
y = wx.Image(self.ic[1], wx.BITMAP_TYPE_ANY).Scale(200, 200)
self.ic[0].SetBitmap(wx.StaticBitmap(self, wx.ID_ANY, wx.BitmapFromImage(y)))
self.ic[1].SetBitmap(wx.StaticBitmap(self, wx.ID_ANY, wx.BitmapFromImage(x)))
self.Refresh()
Aucun commentaire:
Enregistrer un commentaire