I'm doing this a little different (I think). In IB I have a Custom
View called PyDragNDrop which has a custom class "PyDragNDrop". This
identical to the Java-Cocoa example referenced below. In fact, I've
written this small application in Java-Cocoa and customized the
MyView class from the example to provide drag-n-drop functionality -
which works. Now I'm trying to mirror that in PyObjC. I can tell
that the 'def ini(self):' is not being called. I thought the
CustomeView attached to the custom class would cause the init in that
class to be called. This doesn't appear to be the case.
Is the only way to register for draggedTypes via awakeFromNib?
Any help is understanding this is appreciated.
"No one can see past a choice they don't understand." --The Oracle
On Nov 22, 2005, at 3:33 PM, Zachery Bir wrote:
> On Nov 22, 2005, at 3:25 PM, John Ruff wrote:
>> I'm having trouble initializing my drag-n-drop class. I'm pretty
>> much duplicating the Cocoa-Java Drag-N-Drop example found here
>> in a PyObjC Cocoa app (XCode project). I'm subclassing NSView in
>> my PyDragNDrop class but it appears I'm not registering for
>> 'DraggedTypes' correctly.
>> Here's what I have:
>> class PyDragNDrop (NSView):
>> def init(self):
>> self = super(PyDragNDrop, self).init()
>> # register for drag and drop type - filenames...
>> return self
>> Can someone point me in the right direction.
> When I've done it, I've made the register assertion in the App
> Delegate's awakeFromNib():
> class DropView(NibClassBuilder.AutoBaseClass):
> # react to drops here
> class DNDAppDelegate(NibClassBuilder.AutoBaseClass):
> The controller for Drag & Drop
> def awakeFromNib(self):
> # 'drop_zone' is a connection in IB from our AppDelegate to
> the DropView