|
From: Raoul G. <rao...@ya...> - 2006-01-27 17:44:48
|
--- Marcelo Matus <mm...@ac...> wrote:
> Check the docs, you can use the %pythonappend or %pythoncode
> directives
> to add extra code to the proxy methods.
Oh, OK, that did the trick, thanks! I've ended up with something like
this:
%module TraceObject
%{
#include "TraceObject.h"
%}
struct TraceObject
{
// Manually hack in some Python code to save a reference to the
// constructor arguments. This prevents the Python string
// disappearing while the C++ TraceObject object has a
// pointer into it.
%feature("pythonappend") TraceObject {self.saved_init_arguments = args}
TraceObject(char const *);
// ...
};
Couldn't find any docs on this though (I've got swig-1.3.27). Grepped
everything for pythonappend and only matched Source/Modules/python.cxx
--
Raoul Gough.
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
|