Re: [Pyobjc-dev] more on beginSheet
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-01-31 06:51:40
|
On Friday, Jan 31, 2003, at 01:09 Europe/Amsterdam, David Eppstein wrote: > I worked around the missing selector by passing "missingSelector:" as > the argument. > Since it shouldn't get called without a modalDelegate, that should be > ok as a workaround. > Next question: why is the selector for the contextInfo: argument 'i'? > The objc spec is for this to be a (void *), but I am prevented from > passing None here (workaround: pass 0 instead). We use an int argument instead of a (void*) argument on purpose. The only reasonably valid alternative would be to require a buffer-like object (or None for a NULL pointer). Even then you would be required to store a reference to that buffer-like object somewhere, otherwise the buffer might be garbage collected before your callback is called. When we first ran into this problem we did choose the current solution because this (a) makes it explicit that you must keep a reference to the data you want to use and (b) you cannot cause memory corruption by not following the rules (which might happen if we did expose contentInfo as a pointer). Ronald |