Hi,
I have commented out line 154 and it works OK, but I am using standard
windows colours.
My guess is that you should be using
self.SetBackgroundColour(colour)
instead of
wxWindow.SetBackgroundColour(self, colour)
but you have already over-ridden the SetBackgroundColour method, so it will
not work (self refers back to the wxGenButton method rather than to the
wxWindow method through inheritance).
Regards,
Gordon Williams
···
----- Original Message -----
From: "Gordon Williams" <g_will@cyberus.ca>
To: "wxPython List" <wxpython-users@lists.wxwindows.org>
Sent: Tuesday, January 29, 2002 8:44 PM
Subject: wxGenButton error in Demo 2.3.2.1
This is it.
Regards,
Gordon Williams
Traceback (most recent call last):
File "G:\Program
Files\Python22\Lib\site-packages\wxPython\demo\Main.py",
line
330, in OnSelChanged
self.RunDemo(itemText)
File "G:\Program
Files\Python22\Lib\site-packages\wxPython\demo\Main.py",
line
362, in RunDemo
self.window = module.runTest(self, self.nb, self) ###
File "G:\Program
Files\Python22\Lib\site-packages\wxPython\demo\GenericButtons
.py", line 98, in runTest
win = TestPanel(nb, log)
File "G:\Program
Files\Python22\Lib\site-packages\wxPython\demo\GenericButtons
.py", line 21, in __init__
b = wxGenButton(self, -1, 'Hello', (10,65))
File "G:\PROGRA~1\PYTHON22\lib\site-packages\wxPython\lib\buttons.py",
line 78
, in __init__
self.InitColours()
File "G:\PROGRA~1\PYTHON22\lib\site-packages\wxPython\lib\buttons.py",
line 14
2, in InitColours
self.SetBackgroundColour(faceClr)
File "G:\PROGRA~1\PYTHON22\lib\site-packages\wxPython\lib\buttons.py",
line 15
4, in SetBackgroundColour
wxWindow.SetBackgroundColour(self, colour)
TypeError: unbound method SetBackgroundColour() must be called with
wxWindow
ins
tance as first argument (got wxGenButton instance instead)