[wxPython] bug report?

Hi,

I got the following traceback when trying to create a wxGenToggleButton.

File “wizardPages.py”, line 133, in show
self.btn1 = wxGenToggleButton(self.wizard.pagePanel, -1, ‘Click me’)
File “C:\Python22\Lib\site-packages\wxPython\lib\buttons.py”, line 78, in init
self.InitColours()
File “C:\Python22\Lib\site-packages\wxPython\lib\buttons.py”, line 142, in InitColours
self.SetBackgroundColour(faceClr)
File “C:\Python22\Lib\site-packages\wxPython\lib\buttons.py”, line 154, in SetBackgroundColour
wxWindow.SetBackgroundColour(self, colour)
TypeError: unbound method SetBackgroundColour() must be called with wxWindow instance as first argument (got wxGenToggleButton instance instead)

I fixed it by inserting wxWindow in line 55 of wxPython/controls.py making it like this:

class wxGenButton(wxControl, wxWindow):

I haven’t done any other testing (like to see if this fix breaks something else yet). If I find it breaks something I’ll email it here…

I’m running python 2.2.1 Build 222, on WindowsXP Home Edition, and wxPython 2.3.2.1

I know it shouldn’t be a problem because wxControl is derived from wxWindow anyway. But it seems that it is with me :frowning:

GBU

Matthew Sherborne

I got the following traceback when trying to create a wxGenToggleButton.

      wxWindow.SetBackgroundColour(self, colour)
TypeError: unbound method SetBackgroundColour() must be called
with wxWindow instance as first argument (got wxGenToggleButton
instance instead)

This was a known problem due to a change in how Python 2.2 looks for methods
in base classes. It's been fixed in CVS for a long time.

···

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