Hello,
Wondering if someone can help me with this… I’m trying to write a wxPython extension module. I’ve tried just about everything with no luck. Here’s my setup:
Downloaded src distro from wxPython.org,
compiled wxWidgets src with vc7, monolithic unicode build.
compiled wxPython using setup.py, monolithic unicode build
created swig interface file, ran swig (-c++ -python -I… -o…) , compiled generated wrapper into my vc7 dll.
modified setup.py to include my build option which generates the appropriate .py and .pyd files.
When I try to import my library, I get the following:
import wx.m2u_base
Traceback (most recent call last):
File “”, line 1, in ?
File “c:\wxPython-src-2.6.1.0\wxPython\wx\m2u_base.py”, line 43, in ?
class mvpBaseCanvas(_windows.ScrolledWindow):
File “c:\wxPython-src-2.6.1.0\wxPython\wx\m2u_base.py”, line 46, in mvpBaseCanvas
for _s in [_windows.ScrolledWindow]: swig_setmethods.update(_s.swig_setmethods)
AttributeError: type object ‘ScrolledWindow’ has no attribute ‘__swig_setmethods
__’
Here’s my swig interface:
%module (package=“wx”) m2u_base
%{
#include “wx/wxPython/wxPython.h”
#include “wx/wxPython/pyclasses.h”
#include <wx/listctrl.h>
#include <wx/treectrl.h>
#include <wx/imaglist.h>
/* resolve tree dependency; we’re not referencing it anyway */
typedef wxTreeCtrl wxPyTreeCtrl;
#include “wx/wxPython/pytree.h”
#include “c:\projects\mvp\maestro_v3\include\wx\base\base_canvas.h”
%}
//---------------------------------------------------------------------------
%import windows.i
%import controls.i
%pythoncode { import wx }
MAKE_CONST_WXSTRING2(BaseCanvasControlNameStr,wxT(“baseCanvas”));
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
MustHaveApp(mvpBaseCanvas);
class mvpBaseCanvas: public wxScrolledWindow
{
public:
%pythonAppend mvpBaseCanvas "self._setOORInfo(self)"
%pythonAppend mvpBaseCanvas() ""
mvpBaseCanvas(wxWindow *parent, wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const unsigned styleBits = 0,
long style = wxHSCROLL|wxVSCROLL,
const wxString& name = wxPyBaseCanvasControlNameStr);
%RenameCtor(PreBaseCanvas, mvpBaseCanvas());
bool Create(wxWindow *parent, wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const unsigned styleBits = 0,
long style = wxHSCROLL|wxVSCROLL,
const wxString& name = wxPyBaseCanvasControlNameStr);
};
I would greatly appreciate any help,
Thanks in advance,
Michael