Luke Iannini (pd) a écrit :
Hi all, Does anyone (hans?) know if Tk has a widget that will accept dropped files from the OS? I'd be happy to look into adding it to the library if anyone thinks it's possible (and points me in a general direction).
It would be really great to be able to drag a wav file onto my sampler to load them, and I'm sure there are many other uses as well.
(oh, and speaking of that, anyone know anything about adding a "proxy icon" to Pd windows (this would be an OS X only feature, I suppose)? Most OS X apps have one; you can drag from it to get a reference to the file you're working on ( e.g. to copy it to the desktop) or right click it (cmd-click in tiger) to open a clickable hierarchy of the folders it's in, a great way to open the containing folder of a patch.)
Cheers Luke
http://sourceforge.net/projects/tkdnd/
This libray should already exist since the code that is calling it is in pd.tk (proc open_file ), if you install the tkdnd library you will be able to drag and drop patch files. I don't know how to install it on osx, in windows it's in pd/lib/tk in linux it's in /usr/local/lib/tk while pd is in /usr/local/lib. You could make a GUI fork of openpanel that outputs the file path dragged into it? I use the ix library that require toxy/widget, but it would be cool to have a single external for this.