def setImage(self, filename=None) : """Defines the image on a BitmapButton. PROBLEM : once set with a real image, if the PROBLEM : method is called again with an empty PROBLEM : or None filename value to reset the PROBLEM : BitmapButton, this doesn't work : the PROBLEM : previous image is still there. PROBLEM : PROBLEM : I'm using wx v2.6.3.2.1.5 under Debian Sid. """ if filename : image = wx.Image(filename) maskcolour = image.GetOrFindMaskColour() else : image = wx.NullImage maskcolour = wx.NullColour image.Rescale(176, 144) bitmap = wx.BitmapFromImage(image) mask = wx.Mask(bitmap, maskcolour) bitmap.SetMask(mask) self.bitmap_image.SetBitmapLabel(bitmap)