Extending wxPython/wxWindows with new C++ mo dules

I successfully updated SWIG from sourceforge. Had a little trouble with
cygwin compilation. Beware the introduction of "^M". Cygwin needs to
properly installed in UNIX mode, and all autotools need to conform.

After fixing the ^M problem and applying the wxPython patches SWIG built and
ran successfully on the wxPythonSrc distribution. Almost got my own
extension working.

Question: What is the relationship between wx and modules like core and
windows. I'm getting an error message

ImportError no module named _core.

While loading my new wxPython extension.

It seems like it is possible to pickup wx, but not _core.pyd or
_windows.pyd.

Thanks

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Monday, April 19, 2004 4:21 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Extending wxPython/wxWindows with new C++ mo
dules

Schalkwyk, Johan wrote:

I'm trying to get the latest SWIG from CVS in order to build wxPython
extensions.

Are there certain restrictions on CVS access for SWIG.

(Logging in to cvs@swig.cs.uchicago.edu)
CVS password:
cvs.exe [login aborted]: connect to swig.cs.uchicago.edu:2401 failed:
Connection
refused

Alternatively can you provide me a copy of SWIG-cvs windows executable,

that

include the 3 patches required after 1.3.20

Apparently they are moving the CVS repository to SourceForge. I havn't
tried updating from there yet.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Schalkwyk, Johan wrote:

I successfully updated SWIG from sourceforge. Had a little trouble with
cygwin compilation. Beware the introduction of "^M". Cygwin needs to
properly installed in UNIX mode, and all autotools need to conform.

After fixing the ^M problem and applying the wxPython patches SWIG built and
ran successfully on the wxPythonSrc distribution. Almost got my own
extension working.

Question: What is the relationship between wx and modules like core and
windows. I'm getting an error message

Since some compilers *cough*microsoft*cough* croak when there are more than about 64K lines in a .cpp file, I have to split the stuff that appears in the main wx namespace into multiple extension modules, and then merge them back together into a single namespace using python imports. The modules that make up the main wx namespace are core, gdi, windows, controls, and misc. Each of those has an extension module named the same but with a leading underscore: _core, _windows, etc.

ImportError no module named _core.

While loading my new wxPython extension.

It seems like it is possible to pickup wx, but not _core.pyd or
_windows.pyd.

Two possible reasons, either the .pyd files don't exist in the same place that you are importing wx/__init__.py from, or you have built a debug version and so it is looking for _core_d.pyd.

···

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