Accepting files for Drag and drop on OS-X

Christopher Barker Chris.Barker at noaa.gov
Thu Mar 8 10:58:04 PST 2007


HI all,

I'm working on making an app accept files for drag and drop on OS-X. =

I've started with what's on this page:

http://wiki.wxpython.org/index.cgi/Optimizing_for_Mac_OS_X

Which got me most of the way there. However, while I can now drag a file =

onto the icon in the doc when the app is running, and have it call =

MacOpenFile(), if I start the app by dropping a file on it, it doesn't =

seem to register it at all, it just starts without ever calling =

MacOpenFile().

How can I get it to start up with the file dropped on it?

Enclosed is a small sample, that should accept all files for dropping, =

once it's been bundled with py2app.

Tested with:
Python2.5
wxPython 2.8.1
py2app from SVN

I'll try to update the wiki some once I've got this all working.

-Chris


-- =

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ConverterIcon.icns
Type: application/octet-stream
Size: 21894 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
308/e49c304c/ConverterIcon.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py
Type: text/x-python
Size: 1313 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
308/e49c304c/setup.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MacApp.py
Type: text/x-python
Size: 3331 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
308/e49c304c/MacApp.py


More information about the wxpython-users mailing list