wxToolBar-disabled bitmap does not show

I am adding things to the toolbar like this:

self.myTB.AddLabelTool(label='Save',
                bitmap=bmp,
                bmpDisabled=bmpDisabled,
                id=self.wxId_myTBSave,
                longHelp='Save changed data to database',
                shortHelp='Save changed data')

self.myTB.Realize()
       self.myTBEnableToolSave(False)

However when I disable the tool I just get a grey rectangle instead of my bmpDisabled bitmap?

What am I missing?

See you
Werner

Werner F. Bruhin wrote:

I am adding things to the toolbar like this:

self.myTB.AddLabelTool(label='Save',
               bitmap=bmp,
               bmpDisabled=bmpDisabled,
               id=self.wxId_myTBSave,
               longHelp='Save changed data to database',
               shortHelp='Save changed data')

self.myTB.Realize()
      self.myTBEnableToolSave(False)

However when I disable the tool I just get a grey rectangle instead of my bmpDisabled bitmap?

Platform and version?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Sorry, should know by now to include this.

MS XP Pro, Python 2.2, wxPython 2.4.0.7

See you
Werner

Robin Dunn wrote:

···

Werner F. Bruhin wrote:

I am adding things to the toolbar like this:

self.myTB.AddLabelTool(label='Save',
               bitmap=bmp,
               bmpDisabled=bmpDisabled,
               id=self.wxId_myTBSave,
               longHelp='Save changed data to database',
               shortHelp='Save changed data')

self.myTB.Realize()
      self.myTBEnableToolSave(False)

However when I disable the tool I just get a grey rectangle instead of my bmpDisabled bitmap?

Platform and version?

I am having trouble passing the write number of parameters to a function
that I have written. I am inside a class defined like this:

class ComboBoxPanel(wxPanel):

    def __init__(self, parent, ID = -1, size = wxDefaultSize, style= -1):
        wxPanel.__init__(self, parent, ID, wxDefaultPosition, size,
        style=wxSUNKEN_BORDER)

I defined the function like this:

    def ComputeCRC(counter,value2add):
        counter = '\x6e'
        counter = (counter ^ value2add)
        return counter

and the call to it looks like this:

self.ComputeCRC(parameters[1][i],CRCval)

I get an error like this:

TypeError: ComputeCRC() takes exactly 2 arguments (3 given)

Is this because I am within a class that requires that automatically
passes self? I don't really need self. Do I have to create the function
outside of the class to not have to pass the self parameter? Can someone
clear this issue up for me? Thanks.
--vicki

You must add 'self',

def ComputeCRC(self, counter,value2add)

Regards,
Rob

sorry.. I did not read the entire Email so my answer was a bit too short.

Is this because I am within a class that requires that automatically
passes self?

yes

I don't really need self. Do I have to create the function
outside of the class to not have to pass the self parameter?

yes

Can someone clear this issue up for me?

You already did :slight_smile:

If I look at the code you posted it looks like the function is now part of the ComboBoxPanel class which is not a logical place. It would indeed be better to seperate the function from the class. In that case, you won't need the self parameter. But hey.. you already said it yourself!

Regards,
Rob

Werner F. Bruhin wrote:

Robin Dunn wrote:

Werner F. Bruhin wrote:

I am adding things to the toolbar like this:

self.myTB.AddLabelTool(label='Save',
               bitmap=bmp,
               bmpDisabled=bmpDisabled,
               id=self.wxId_myTBSave,
               longHelp='Save changed data to database',
               shortHelp='Save changed data')

self.myTB.Realize()
      self.myTBEnableToolSave(False)

However when I disable the tool I just get a grey rectangle instead of my bmpDisabled bitmap?

Platform and version?

MS XP Pro, Python 2.2, wxPython 2.4.0.7

Does it make any difference with different images in the toolbar? (For example, with simple 16 color images instead of images with many colors?) How about if you change the color depth of your display? And finally, does using wxPython 2.4.1.2 make a difference?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!