RM11
1
This bit of SWIG magic eludes me, in spite of having traced quite a
bit of the code through their wrappers. E.g., how does
class wxSize
{
public:
%Rename(width, int, x);
%Rename(height,int, y);
%pythoncode { x = width; y = height }
...
end up as
class Size(object):
in _core.py and
SWIGINTERN PyObject *_wrap_new_Size(PyObject *SWIGUNUSEDPARM(self),
PyObject *args, PyObject *kwargs) {
in _core_wrap.cpp, when if would normal wrap to wxSize?
I'd like to do something similar with my extension of wxFrame.
Robin
2
This is one of the customizations I've added to SWIG. It's essentially a global pattern-matched rename that is turned on in _defs.i with:
%rename("%(wxpy)s") "";
···
On 9/18/09 6:28 PM, RM wrote:
This bit of SWIG magic eludes me, in spite of having traced quite a
bit of the code through their wrappers. E.g., how does
class wxSize
{
public:
%Rename(width, int, x);
%Rename(height,int, y);
%pythoncode { x = width; y = height }
...
end up as
class Size(object):
in _core.py and
SWIGINTERN PyObject *_wrap_new_Size(PyObject *SWIGUNUSEDPARM(self),
PyObject *args, PyObject *kwargs) {
in _core_wrap.cpp, when if would normal wrap to wxSize?
--
Robin Dunn
Software Craftsman