Fog Creek Software
Discussion Board




Multi platform drag and drop

Me and some of my friends are developing some tool which relies heavily on dragging and dropping files from and to our tool. So our tool should also accept drops from external programs.
The audience of our tool are musicians and more than 50% (specially the professional ones) use MAC for their musical creativity.

.NET handles all this nicely for us, but not (yet?) on the MAC.

I've done some research with trolltech's QT, Realbasic and wxWindows but haven't managed yet to implement some generic (i.e. dragging and dropping to and from other programs, like for instance the windows explorer) drag and drop. I'm almost sure it is possible but I'm wondering if someone can give me a clue about which toolkit provides the best multiplatform (that is, windows and MAC) drag and drop?

Thanx in advance!

Jurgen
Monday, June 07, 2004

I'm not exactly sure what you are asking, but I have a Java program that has drag sources, and drop targets, which works equally well on Windows, OS X and Linux.

Rhys Keepence
Monday, June 07, 2004

But does it also accept drops from other programs? on all platforms?

Jurgen
Monday, June 07, 2004

Its Mac, mac or mAC...._not_ MAC

Mac is _not_ an acronym.

gods I hate windsucksmyasshole users.

geesh
Monday, June 07, 2004

You had to go and ruin a perfectly good thread, didn't you?

About Java, although Swing is quite fast now, I noticed that Swing applications still use an incredible amount of memory.
So, be carefull with that.

RP
Monday, June 07, 2004

Thanx for the feedback so far (that is, for most feedback...)

Sorry, I'm unfamiliar with Java and therefore I actually never thought about using Java for our tool.

But, nevertheless I wonder if Java programs will handle drags and drops to/from other (native) Windows or Mac (!) programs?

Can anyone prove/show me that? (I'll look at it myself also)
If so, I'll certainly take Java into account.

Jurgen
Monday, June 07, 2004

Jurgen: In response to your earlier questions, the answer is yes and yes.

Some information is here: http://java.sun.com/j2se/1.4.2/docs/guide/dragndrop/

Rhys Keepence
Monday, June 07, 2004

The memory, oh, the memory....

RP
Monday, June 07, 2004

The Java Tutorial page on drag and drop might be useful as well:

http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html

Karl
Monday, June 07, 2004

realbasic has worked fine for me, although i've not done a great deal of filesystem drags. 

Zealot
Monday, June 07, 2004

One thing you may want to consider is building a common layer for your functional code, and consuming that from UI shells written specifically for each platform.  That way you can give your users an interface which looks appropriate for their OS, and avoid forcing them to install additional libraries like QT. 

Joe
Monday, June 07, 2004

I've used both Java and wxWidgets, and both do drag-n-drop.  I don't know what's "not native" about them.  I could drag-from and drop-to files or text or URLs from any other program.

(FWIW, DND seemed about 5x easier in wxWidgets than Java.  Unfortunately wxMac is the least developed of the ports, so it may not be appropriate for an app that's primarily targeted at Mac users, but they're working hard on that right now.)

Another option is to write the back-end of the tool in something portable (C/C++? a scripting language like Python?), and build that as a library.  Then make a native front-end for each platform -- on Windows maybe in C#, and on the Mac in Cocoa.  Writing platform-independent GUI code can be a bear, and if it's relatively small and isolatable, it might be easier just to use specialized native environments on each target platform.

Kyle
Tuesday, June 08, 2004

*  Recent Topics

*  Fog Creek Home