-%typemap(python, out) wxPyShape* { $target = wxPyMake_wxObject($source); }
-%typemap(python, out) wxPyShapeEvtHandler* { $target = wxPyMake_wxObject($source); }
-%typemap(python, out) wxPyShapeCanvas* { $target = wxPyMake_wxObject($source); }
-%typemap(python, out) wxDiagram* { $target = wxPyMake_wxObject($source); }
-%typemap(python, out) wxOGLConstraint* { $target = wxPyMake_wxObject($source); }
-%typemap(python, out) wxPyDivisionShape* { $target = wxPyMake_wxObject($source); }
-%typemap(python, out) wxPseudoMetaFile* { $target = wxPyMake_wxObject($source); }
-%typemap(python, out) wxArrowHead* { $target = wxPyMake_wxObject($source); }
+%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
+%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
+%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
+
+%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxDiagram* { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxOGLConstraint* { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxPseudoMetaFile* { $result = wxPyMake_wxObject($1, $owner); }
+%typemap(out) wxArrowHead* { $result = wxPyMake_wxObject($1, $owner); }