wxButton and wxCoulor

I work on linux.
I can't assign a backGroundCoulor to a button (the function doesn't indicate
an error, but the button remains gray).

Finally I try to recover the name of the color to pass it in label boutton.
But that doesn't go either.

Below, part of code and the error which is then indicated to me.
CODE:
  self.d = wxColourDatabase(self) print (self.d).FindName(wxColour(0,0,0))

ERROR:
  print (self.d).FindName(wxColour(0,0,0)) File
  "/usr/lib/python2.2/site-packages/wxPython/gdi.py ", line 294, in FindName
  valley = apply(gdic.wxColourDatabase_FindName, (self) + _ args, _ kwargs)
  TypeError: Error type in argument 1 of wxColourDatabase_FindName. Expected
  _ wxColourDatabase_p.

I doesn't understand my error. Can you help me?

    Emilie Habermacher (FRANCE)

Habermacher EMILIE wrote:

I work on linux. I can't assign a backGroundCoulor to a button (the function doesn't indicate an error, but the button remains gray).

Some gtk themes don't allow the colours of the widgets to be changed.

Finally I try to recover the name of the color to pass it in label boutton. But that doesn't go either.

Below, part of code and the error which is then indicated to me. CODE: self.d = wxColourDatabase(self) print (self.d).FindName(wxColour(0,0,0))

There is a instance of the wxColourDatabase already that you should use instead, named wxTheColourDatabase.

>>> wxTheColourDatabase.FindName(wxColour(0,0,0))
'BLACK'

···

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