wxpython AttributeError!

frank frank at pc-nett.no
Fri Jan 9 17:19:37 EST 2004


need help with wxpython.
wxpython code is made with boa-constructor

when i run the code i get this error message:

Traceback (most recent call last):
File "wxApp1.py", line 24, in ?
main()
File "wxApp1.py", line 20, in main
application = BoaApp(0)
File "K:\Python23\lib\site-packages\wxPython\wx.py", line 1945, in __init__
_wxStart(self.OnInit)
File "wxApp1.py", line 13, in OnInit
self.main = wxFrame1.create(None)
File "wxFrame1.py", line 12, in create
return wxFrame1(parent)
File "wxFrame1.py", line 220, in __init__
self._init_ctrls(parent)
File "wxFrame1.py", line 157, in _init_ctrls
EVT_RIGHT_DOWN(self.treeCtrl1, self.OnTreectrl1RightDown)
AttributeError: wxFrame1 instance has no attribute 'OnTreectrl1RightDown'
23:06:44: Debug: c:\PROJECTS\wx\src\msw\app.cpp(439):
'UnregisterClass(canvas)' failed with error 0x00000584 (class still has open
windows.).

this is the code have this code:

self.treeCtrl1 = wxTreeCtrl(id=wxID_WXFRAME1TREECTRL1, name='treeCtrl1',
              parent=self.splitterWindow1, pos=wxPoint(2, 2),
size=wxSize(200,
              610), style=wxTR_HAS_BUTTONS, validator=wxDefaultValidator)
        self.treeCtrl1.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxNORMAL,
False,
              'Microsoft Sans Serif'))
        EVT_RIGHT_DOWN(self.treeCtrl1, self.OnTreectrl1RightDown)
        EVT_TREE_SEL_CHANGED(self.treeCtrl1, wxID_WXFRAME1TREECTRL1,
              self.OnTreectrl1TreeSelChanged)

and the event EVT_RIGHT_DOWN code is:

def OnTreectrl1RightDown(self, event):
          dosomething()
          event.Skip()

the "OnTreectrl1RightDown" is in the wxframe class
what to do?
thanx in advance





More information about the Python-list mailing list