[wxPython] 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)

    self.SetBackgroundColour(faceClr)
  File "G:\PROGRA~1\PYTHON22\lib\site-packages\wxPython\lib\buttons.py",
ne 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)

This has already been fixed. YOu can get the new version of buttons.py from
CVS or at
http://cvs.wxwindows.org/cgi-bin/viewcvs.cgi/wxPython/wxPython/lib/

···

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

Was there a similar fix for wxListCtrl? I just ran into what appear to be identical errors appearing in Boa 1.0a with the generic button and list controls. Popping in the updated buttons.py fixed the generic button problem.

Curiouser and curiouser became Alice,
Mike

Robin Dunn wrote:

   self.SetBackgroundColour(faceClr)
File "G:\PROGRA~1\PYTHON22\lib\site-packages\wxPython\lib\buttons.py",
ne 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)

This has already been fixed. YOu can get the new version of buttons.py from
CVS or at
http://cvs.wxwindows.org/cgi-bin/viewcvs.cgi/wxPython/wxPython/lib/

...

Was there a similar fix for wxListCtrl? I just ran into what appear to
be identical errors appearing in Boa 1.0a with the generic button and
list controls. Popping in the updated buttons.py fixed the generic
button problem.

This is a new one to me. Do you have a quick code sample that shows the
error?

···

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

Not really a code sample, but here's how it occurs:

Open Boa 1.0a
Create a window (I was using wxTransientPopupWindow)
Add a list control
Click on the list control to select it.

I added a sourceforge bug to Boa about it before reading the Generic Button posting here. If this is caused by the 2.2 type unification (it sounds like it is), it would make sense that this is affecting other parts of Boa, not because there's a problem in wxPython, but because they may be doing diamond-pattern inheritence (that's what changed, right?)

Here are the tracebacks:

23:19:20: if dsgn.selectControlByPos(ctrl, event.GetPosition(), event.ShiftDown()):
23:19:20: File "P:\boa\Views\Designer.py", line 722, in selectControlByPos
23:19:20: self.compPal.selection[2], pos)

23:19:20: File "P:\boa\Views\Designer.py", line 446, in newControl

23:19:20: companion.designTimeControl(position, size), parentName)

23:19:20: File "P:\boa\Companions\BaseCompanions.py", line 540, in designTimeControl
23:19:20: self.control = apply(self.ctrlClass, (), self.designTimeDefaults(position, size))
23:19:20: File "C:\bin\lang\py22\lib\site-packages\wxPython\lib\buttons.py", line 78, in __init__
23:19:20: self.InitColours()

23:19:20: File "C:\bin\lang\py22\lib\site-packages\wxPython\lib\buttons.py", line 142, in InitColours
23:19:20: self.SetBackgroundColour(faceClr)

23:19:20: File "C:\bin\lang\py22\lib\site-packages\wxPython\lib\buttons.py", line 154, in SetBackgroundColour
23:19:20: wxWindow.SetBackgroundColour(self, colour)

23:19:20: TypeError: unbound method SetBackgroundColour() must be called with wxWindowinstance as first argument (got wxGenButton instance instead)
23:22:41: TypeError: unbound method SetBackgroundColour() must be called with wxWindowinstance as first argument (got wxGenButton instance instead)Traceback (most recent call last):
23:22:41: TypeError: unbound method SetBackgroundColour() must be called with wxWindowinstance as first argument (got wxGenButton instance instead) File "P:\boa\Views\Designer.py", line 1257, in OnControlRelease

23:22:41: dsgn.selection.moveRelease()

23:22:41: File "P:\boa\Views\SelectionTags.py", line 242, in moveRelease
23:22:41: self.positionUpdate()

23:22:41: File "P:\boa\Views\SelectionTags.py", line 411, in positionUpdate
23:22:41: self.inspector.constructorUpdate('Position')

23:22:41: File "P:\boa\Inspector.py", line 262, in constructorUpdate
23:22:41: self.pageUpdate(self.constr, name)

23:22:41: File "P:\boa\Inspector.py", line 258, in pageUpdate

23:22:41: page.initFromComponent(name)

23:22:41: File "P:\boa\Inspector.py", line 1000, in initFromComponent
23:22:41: nv.initFromComponent()

23:22:41: File "P:\boa\Inspector.py", line 736, in initFromComponent
23:22:41: self.propEditor.persistValue(self.propEditor.valueAsExpr())
23:22:41: File "P:\boa\PropEdit\PropertyEditors.py", line 210, in persistValue
23:22:41: self.companion.persistProp(self.name, funcName, value)

23:22:41: File "P:\boa\Companions\Companions.py", line 1130, in persistProp
23:22:41: ContainerDTC.persistProp(self, name, setterName, value)

23:22:41: TypeError: unbound method persistProp() must be called with ContainerDTC instance as first argument (got ListCtrlDTC instance instead)
23:22:41: TypeError: unbound method persistProp() must be called with ContainerDTC instance as first argument (got ListCtrlDTC instance instead)Traceback (most recent call last):
23:22:41: TypeError: unbound method persistProp() must be called with ContainerDTC instance as first argument (got ListCtrlDTC instance instead) File "P:\boa\Views\Designer.py", line 1301, in OnControlResize
23:22:41: dsgn.selection.sizeFromCtrl()

23:22:41: File "P:\boa\Views\SelectionTags.py", line 316, in sizeFromCtrl
23:22:41: self.sizeUpdate()

23:22:41: File "P:\boa\Views\SelectionTags.py", line 414, in sizeUpdate
23:22:41: self.inspector.constructorUpdate('Size')

23:22:41: File "P:\boa\Inspector.py", line 262, in constructorUpdate
23:22:41: self.pageUpdate(self.constr, name)

23:22:41: File "P:\boa\Inspector.py", line 258, in pageUpdate

23:22:41: page.initFromComponent(name)

23:22:41: File "P:\boa\Inspector.py", line 1000, in initFromComponent
23:22:41: nv.initFromComponent()

23:22:41: File "P:\boa\Inspector.py", line 736, in initFromComponent
23:22:41: self.propEditor.persistValue(self.propEditor.valueAsExpr())
23:22:41: File "P:\boa\PropEdit\PropertyEditors.py", line 210, in persistValue
23:22:41: self.companion.persistProp(self.name, funcName, value)

23:22:41: File "P:\boa\Companions\Companions.py", line 1130, in persistProp
23:22:41: ContainerDTC.persistProp(self, name, setterName, value)

23:22:41: TypeError: unbound method persistProp() must be called with ContainerDTC instance as first argument (got ListCtrlDTC instance instead)

Afraid I'm in the middle of something just now, or I would go spelunking through Boa's innards to figure out what's going on. For now I'm just going back to hand-coding the project.

Enjoy,
Mike

Robin Dunn wrote:

Was there a similar fix for wxListCtrl? I just ran into what appear to
be identical errors appearing in Boa 1.0a with the generic button and
list controls. Popping in the updated buttons.py fixed the generic
button problem.

This is a new one to me. Do you have a quick code sample that shows the
error?

...

Hi Mike, these are bugs in Boa.

This is what's happening:

class A:
  def m(self): pass

class B(A):
  def m(self): A.m(self)

class C(B):
  def m(self): A.m(self)

c = C()
c.m()

This snippet use to be work under Python >= 2.1 (although it is usually
a copy paste error) but doesn't under Python 2.2.

As I've said on the Boa list, I hope to release Boa 0.1.1 soon, as there
are a few places in the code base this problem occurs.

···

--
Riaan Booysen
___________________________________________________
Boa Constructor - RAD GUI building IDE for wxPython
     http://boa-constructor.sourceforge.net