Need help: Trying to use PyObject_CallMethod, PyObject_CallFunction, seems to fail quietly.
parz at home.com
Wed Aug 1 08:39:49 CEST 2001
I am using ActiveState Python 2.1 on Win 2000.
I am trying to call a method of an object from C, using code like this:
--- in C code:
static PyObject *_App;
if ( _App )
PyObject_CallMethod(_App, "OnRClick", "ii", Point.x, Point.y);
--- in Python code
_top = None
# Pass self as the object containing "OnRClick" to MyWin extension module
MyWin.CreateWindow(self, "EmsView 1.0")
wxApp._top = top
def OnRClick(self, x, y):
print "OnRClick x=", x, "y=", y
event = _PosEvent(0, wxEVT_RIGHT_UP, (x,y))
The PyObject_CallMethod is definitely reached, but the OnRClick method is
apparently not invoked. There are no exceptions or traps.
Using PyObject_CallFunction on a global function seems to behave in the same way.
What am I doing wrong here?
More information about the Python-list