[Pythonmac-SIG] Drag and drop apps?

Bob Ippolito bob at redivi.com
Sun Jan 15 03:01:44 CET 2006


On Jan 14, 2006, at 5:41 PM, Ken Brooks wrote:

> Just curious, has anyone ever managed to make a drag-and-drop MacOS  
> app with Python?  I'd love to make an image-batch-processing app  
> that works this way (to pad photos to match my extra-wide Powerbook  
> 17' screen).

Yes, of course.

> If so, what is the protocol for discovering what file(s) have been  
> dropped on you?

Depends on what UI toolkit you're using.  For PyObjC/Cocoa, here's  
Apple's documentation:
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/

If it's just a droplet with no UI (a command line tool that takes  
filenames on sys.argv), you can get away with py2app's argv_emulation  
option.

-bob



More information about the Pythonmac-SIG mailing list