Just saw this interesting page:
http://www.dabeaz.com/cgi-bin/wiki.pl?SwigFaq/Python
It says "Typemaps are powerful, but often beginners (like me) start to
see them as the be-all and end-all of fiddling with parameters and end
up missing simpler ways to achieve things. Using %extend allows you to
create new functions with parameters how you want them. Using %{ %}
allows you to create new functions that you can get swig to wrap."
and then has a couple examples, including:
%{
//add new ''add'' function that returns ans instead of returning
via out
parameter
int myadd(int a, int b) {
int c;
add(a, b, &c);
return c;
}
%}
//get swig to wrap myadd as "add"
%name(add) int myadd(int a, int b);
If we''re having problems figuring out the right typemaps to get stuff
like this done, this trick might help. I haven''t looked at the problem
wx cases recently, so maybe not. Just wanted to share it in case you
hadn''t seen this page.
Kevin