[wxpython-users] wx.ArtProvider and wx.BitmapButton

Cody Precord codyprecord at gmail.com
Tue Apr 1 07:43:55 PDT 2008


Hello,

You have the parameters backwards in the GetBitmap method:

Change: bmp=wx.ArtProvider.GetBitmap(wx.ART_OTHER, wx.ART_DELETE,  
(32,32))

To: bmp=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_OTHER, (32,32))

cody


On Apr 1, 2008, at 9:38 AM, Ludovic Reenaers wrote:

>
> Hello all,
>
> I'm facing such a strange issue (probably because of my weak  
> knowledge of wx). I googled a lot, but didn't find any path to  
> follow. What I actually want to do is to use standard ArtProvider  
> from wx to set som bitmapbutton faces.
> I'd like to use wx.ART_DELETE from wx.ART_OTHER. it seems that it  
> does not work! is it a normal behaviour?
>
> here is my scrappy peace of code :
>
> class SimpleTaskPanel(wx.Panel):
>     def __init__(self, parent,taskObj):
>         wx.Panel.__dict__['__init__'](self, parent, size=(1,1))
>         self.__sizer = rcs.RowColSizer()
>         self.bmp=wx.StaticBitmap(self, -1,wx.EmptyBitmap(16,16))
>         bmp=wx.ArtProvider.GetBitmap(wx.ART_OTHER, wx.ART_DELETE,  
> (32,32))
>         self.bmp.SetBitmap(bmp)
>         self.butt=wx.BitmapButton(self, -1, self.bmp,(1,  
> 1),style=wx.NO_BORDER)
>         self.__sizer.Add(self.butt,col=1,row=1)
>         self.SetSizer(self.__sizer)
>         self.Layout()
>
> first I've been trying that one:
>
> class SimpleTaskPanel(wx.Panel):
>     def __init__(self, parent,taskObj):
>         wx.Panel.__dict__['__init__'](self, parent, size=(1,1))
>         self.__sizer = rcs.RowColSizer()
>         self.bmp=wx.ArtProvider.GetBitmap(wx.ART_OTHER,  
> wx.ART_DELETE, (32,32))
>         self.butt=wx.BitmapButton(self, -1, self.bmp,(1,  
> 1),style=wx.NO_BORDER)
>         self.__sizer.Add(self.butt,col=1,row=1)
>         self.SetSizer(self.__sizer)
>         self.Layout()
>
> ...but none of them seems to be workable...the result I got was a  
> very small circular button (yeah, really, circular???!!) with no  
> image at all...and no error message at all...
>
> does anyone have an idea?
>
> thanks in advance,
>
> Ludovic Reenaers_______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users



More information about the wxpython-users mailing list