Re: [Pyobjc-dev] Handling (void *)
Brought to you by:
ronaldoussoren
From: Jack J. <Jac...@cw...> - 2002-11-08 11:05:37
|
On Friday, Nov 8, 2002, at 11:31 Europe/Amsterdam, Ronald Oussoren wrote: > BTW. Jack's solution (None->nil, PyCObject->extract the pointer, ...) > is a better solution for almost anything with the possible exception > of the userInfo arguments in some Cocoa APIs. This does work correctly > with 'void*-as-pointer-to-block-of-memory'. So the remaining problem is to decide which of two things a (void *) is. If it is a pointer to a block of memory we should use my method. On the other hand, if it is a callback cookie we should just allow passing of any Python object and show the Python object itself on the receiving side. The latter is fairly easy to implement: the quick-and-dirty-and-dangerous implementation simply does a cast. And if we want to be on the safe side we could use a small wrapper object (so we could check on the receiving side that we're actually getting what we thing we are). The difficult bit, I think, would be to decide which void* argument falls into which category. -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |