Re: [Pyobjc-dev] Does drag & drop work?
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-05-30 13:14:43
|
On Friday, May 30, 2003, at 14:11 Europe/Amsterdam, Dinu Gherman wrote: > Ronald Oussoren: > >> It's the old 'you should have mentioned your implementing a protocol' >> problem. MyFileWell should inherit from NSDraggingSource and >> NSDraggingDestionation (see the warnings in the output panel in PB if >> you're using a recent CVS version of PyObjC). > > Argh, but funny the destination dragging is working fine! If I add > these protocols I need to implement all sorts of methods which PB > now (on 0.9) complains are lacking, but I guess this can be defin- > ed somewhere as optional/informal. The crash your seeing is caused by call from ObjC to draggingSourceOperationMaskForLocal:. This method has a plain C type (int) as its argument. Because you didn't specify a protocol, the bridge is assuming that all arguments are objects and therefore it tries to interpret the integer that's passed to this method as if it were an 'id' (pointer to an object). I supose a dragging destionation doesn't have to define methods that receive plain C types as arguments. I'm not sure if the current definitions for NSDraggingSource and NSDraggingDestionation are entirely correct w.r.t. required methods, I suppose they are too strict. Ronald |