[Pyobjc-dev] Problem with informal protocol detection? (outlineView:writeItems:toPasteboard:)
Brought to you by:
ronaldoussoren
From: Ben R. <ben...@ma...> - 2006-04-17 12:07:58
|
Has anyone tried to implement this: http://allusions.sourceforge.net/articles/treeDragPart1.php in PyObjC? I've managed to get it working with CoreData, but am having problems with the drag-and-drop in the PyObjC version. In particular, I suspect that the following routine: class DragController(...) ... def outlineView_writeItems_toPasteboard_(self, outlineView, items, pboard): raise RuntimeError pboard.declareTypes_owner_(self.dragType, self) self.draggedNode = items.objectAtIndex_(0) return True is never being called. The drag, of course, never begins. (The RuntimeError is there for the purposes of call-detection.) I've tried to override the respondsToSelector_() method to see if it is even being called with the appropriate argument by the NIB framework but seem to be missing some magic encantation necessary to do so. I think that I'm doing the necessary prep work in the following method: def awakeFromNib(self): self.dragType = ("factorialDragType",) self.treeTable.registerForDraggedTypes_(self.dragType) [...] Vitals: XCode 2.2.1 Python 2.3.5 OS X 10.4.6 |