Re: [Pyobjc-dev] Handling (void *)
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2002-11-08 06:41:43
|
On Thursday, Nov 7, 2002, at 17:12 Europe/Amsterdam, bb...@ma... wrote: > That seems like about as close to a workable set of behaviors as we > can get without special casing certain methods. For contexts that > use a (void *) as a bit of userInfo, we simply need to make sure that > a Python object passed in can be recovered during the call back. I thought of an simpler way to "fix" this on the way home last night. PyObjC has a mechanism to change the signatures of Objective-C methods as seen from Python. We could use this to change all '(void*)userInfo' arguments to '(int)userInfo' arguments. At the very least this allows us to actually use these methods until we come up with a better solution. If the userInfo will always be passed back to Python code this is solution is good enough for me: Even if you wanted to pass a python object you could stuff that Python object into a list and pass the list index to the selector. This obviously is not the right fix in general (what if you want to use an existing method that expects a pointer to some data). Ronald |