[wxpython-users] wx.ArtProvider and wx.BitmapButton
Ludovic Reenaers
lreenaers at hotmail.com
Tue Apr 1 07:51:34 PDT 2008
hello,
Thanks a lot....amazing I was reading this:
http://code.google.com/p/editra/source/diff?r=638&format=side&path=/trunk/src/ed_cmdbar.py
from you Cody!! just the second before I understood my error and 2 second before you answer :)
Anyway, thank you for your prompt answer and please excuse myself for the noise
Ludo
----------------------------------------
> From: codyprecord at gmail.com
> Subject: Re: [wxpython-users] wx.ArtProvider and wx.BitmapButton
> Date: Tue, 1 Apr 2008 09:43:55 -0500
> To: wxpython-users at lists.wxwidgets.org
>
> 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
>
> _______________________________________________
> 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