[C++-sig] Using a phython function as callback

jochen jochen at neverEngine.com
Tue Jun 24 22:12:20 CEST 2003


Thanks for the hint, but I can't figure out how to use it correctly:

What I do is:

SelectableObject*			pSelectable;
...
PyObject*				pCB		= pSelectable->GetOnUpdateSelectionCallBack();

if ( PyCallable_Check( pCB ) )
{
	boost::python::call< void >( pCB, pSelectable );
}

Py_DECREF( pCB );


But the call raises a exection:
boost::python::error_already_set


How do I correctly convert the instance of type SelectableObject to a valid
PyObject ?





More information about the Cplusplus-sig mailing list