1
// macro to delegate the ownership of a class to C++
2
%define CHANGE_OWNERSHIP(name)
3
%pythonappend name##::##name %{
5
# retain reference to label
6
self.my_label = args[5]
7
if self.parent() != None:
8
# delegate ownership to C++
13
// macro to revert the ownership
14
%define REVERT_OWNERSHIP(name)
17
if self.parent() != None:
18
#delegate ownership to C++
21
#give ownership back to Python