[MacRuby-devel] How do I handle file drop events in HotCocoa?

Jeff Cohen cohen.jeff at gmail.com
Sat Mar 14 21:09:56 PDT 2009


Hello,

I'm just getting started with MacRuby and HotCocoa (was a longtime .NET
developer, and wasn't interested in learning Cocoa until MacRuby came
along).  I have a simple HotCocoa app with just a table view, and I'd like
the user to be able to drop a filename from the Finder onto the table view
(or anywhere in my app). I can call registerForDraggedTypes() on my table
view object successfully.  But I'm not sure how to have events delegated to
my Application class (or if that's even possible).

Looking at the hotcocoa source for wrapping NSView (view.rb), I don't see
delegate mappings for the draggingEntered or performDragOperation events.  I
think I need to do something like the mapping code does and write code like
this:

delegating "draggingEntered", :to => :dragging_entered

but I don't know where I can or should do that, or if I'm even on the right
track.

Any hint of where I should get started would be appreciated.

Thanks!
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20090314/3c85b901/attachment.html>


More information about the MacRuby-devel mailing list