delete $1;
}
-
-
-%typemap(out) wxString {
-%#if wxUSE_UNICODE
- $result = PyUnicode_FromWideChar($1.c_str(), $1.Len());
-%#else
- $result = PyString_FromStringAndSize($1.c_str(), $1.Len());
-%#endif
-}
-
-
-%typemap(out) wxString* {
+%typemap(out) wxString& {
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1->c_str(), $1->Len());
%#else
}
-%typemap(out) wxString& {
+%apply wxString& { wxString* }
+
+
+
+%typemap(out) wxString {
%#if wxUSE_UNICODE
- $result = PyUnicode_FromWideChar($1->c_str(), $1->Len());
+ $result = PyUnicode_FromWideChar($1.c_str(), $1.Len());
%#else
- $result = PyString_FromStringAndSize($1->c_str(), $1->Len());
+ $result = PyString_FromStringAndSize($1.c_str(), $1.Len());
%#endif
}
-
%typemap(varout) wxString {
%#if wxUSE_UNICODE
$result = PyUnicode_FromWideChar($1.c_str(), $1.Len());