Drag and drop files on OF window?

Hello all!

Any ideas on how to get info from dran’n’dropped files?

I want to be able to do the same things as in this excellent Processing library from Sojamo: http://www.sojamo.de/libraries/drop/

Would be great if someone could share his experience with that kind of stuff!

Thanks a lot!


since c++ is not java this will be really platform dependant, i guess you need it for mac?

Ok, Thanks Moka!

Actually I’m developing on windows but I was looking for a multiplatform solution (or at least Win / Mac, the guys I’m working with are on osx!) …

So yes I need it also for mac, I was planning to write something like ofxDrop!

Would be great if you already know how to do it on mac! :slight_smile:

You can do this really easily with a cocoa window. Not sure about a cross platform option…

a drag an drop addon would be great –

here’s more info, specific to windows:


I think wxwindows and qt both have this, it might be interesting to poke around their source and see how they are implemented.

take care,

Thank you guys!

I’m going to take a look at those links!

Actually I was hoping that someone would came up with some glut secret features or something like that! :slight_smile:

I just tried the QT example and it works great! I’m going to check the sources tonight!

I’ll update this post with what I will find!

Hello All – any progress on this simongeilfus? Like vanderlin said, this is pretty trivial to do with Cocoa. It would also be pretty straight forward to do with carbon (assuming you are using a carbon-based windowing system). But I’m not as familiar with the Windows side of things.

Regarding how it is done in other Mac windows environments …

On OSX the primary wxWidgets release is still implemented in Carbon, so they use the carbon event system to get the drag’n’drop events. Of course, Carbon does not (and will not ever, according to Apple) support 64-bit builds. According to my reading, wxWidgets is working on a Cocoa port which uses the Cocoa event system for drag’n’drop.

QT has legacy carbon (which uses the carbon events system like wxwidgets), but also recently released a Cocoa port. I believe it is now default on 10.6.

So, it seems that the idea of a completely transparent drag’n’drop plugin depends on both the platform and the windowing system that is chosen. Since OF now makes it pretty easy to use alternative windowing systems, this makes it a little more tricky.

Perhaps a drag’n’drop plugin might simply create a standard interface that various windowing plugins can implement? While we’re at it, there are plenty of windowing-based tricks that should probably also be implemented …


Christopher Baker