Forums RubyCocoa

 
Generic-user-small Nick Ludlam 1 post

Hi,
I’ve looked through the TOC and can’t see anything explicitly written on whether there’ll be a chapter/section on implementing drag-and-drop support in a RubyCocoa application.

Since that’s one of the main reasons I’ve started to look at branching out into native Cocoa from pure web development, it would be really nice to see something written on this. I’ve not run into much discussion on this topic (specifically RubyCocoa) via Google.

Any chance of this kind of topic being covered? Something like dragging an image file onto an NSImageView subclass, or pasting into it with Apple-v.

Thanks,
Nick

 
Generic-user-small Gregory Clarke 3 posts

Hi Nick,

I managed to implement drag-and-drop in a just released application. It’s dragging and dropping rows between two NSTableViews. There’s minimal stuff specific to RubyCocoa unfortunately – I was a complete noob when I added this back in November, and didn’t really understand translating the ObjC code to RubyCocoa, so made many mistakes.

Basically to get things working it needed a couple of pasteboards and a few required methods that the drag and drop are expecting. A code example would be great though – my successes in RubyCocoa have often come from a google search finding a code listing showing how someone else has done it.

Greg

 
England-small_small Brian Marick 27 posts

I’ve put a drag-and-drop example onto my plan. It will be dragging a directory from the Finder and dropping it onto a table field that holds a pathname.

Page limit is going to be a problem, so it might not make it in.

3 posts, 3 voices