Hi there,
Does anyone know how to create a null bitmap or how to clear the bitmap set on the button object?
I’m using platebtn and changing the icon to null bitmap at run-time like this:
In the sample code, wx.Bitmap(0,0) is used as null bitmap. There is no problem up to wx version 4.0.7. However, since 4.1.0 it fails with Assertion error.
import wx
import wx.lib.platebtn as pb
class Panel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.btn = pb.PlateButton(self, label="test", size=(60,-1))
icon = wx.ArtProvider.GetBitmap(wx.ART_TICK_MARK)
self.btn.SetBitmap(icon) # ok
## self.btn.SetBitmap(wx.Bitmap()) # NG
## self.btn.SetBitmap(wx.NullBitmap) # NG
self.btn.SetBitmap(wx.Bitmap(0,0)) # NG... from 4.1.0
if __name__ == "__main__":
app = wx.App()
frm = wx.Frame(None)
panel = Panel(frm)
frm.Show()
app.MainLoop()
I think app.SetAssertMode(wx.APP_ASSERT_SUPPRESS)
is one of the options, but not preferable.
I appreciate any adivice.
Thanks in advance!