[Pythonmac-SIG] How to make an apt except Drag and Drop
daniellord at mac.com
Sun Mar 11 00:14:58 CET 2007
I found an example in a wiki that works perfectly accepting objects
before and after startup.
Towards the end there is a sample wxPython applications and a
Be aware that you need to replace a line in the setup.py:
change "from setuptools import setup"
to "from distutils.core import setup"
but with that one change it worked perfectly for me.
My system is OS X 10.4.8 python 2.5 MacbookPro core 2 Duo
On Mar 8, 2007, at 10:32, Christopher Barker wrote:
> Hi all,
> I'm working on making an app accept drag and drop of files. It appears
> to do that I need to put the right incantations into the plist in the
> app bundle.
> Py2app helps out a lot with that, but now I need to figure out what
> incantations I need.
> The case at hand is a text editor, so I want:
> - It should accept ALL text files for editing.
> - It shouldn't impose its icon on anything.
> - Maybe it should accept all files -- you never really know, and it
> really bugs me when an app won't accept a file that the OS thinks it
> doesn't know what to do with -- if I get Garbage, I get Garbage.
> This is what I've tried:
> Plist = dict(CFBundleDocumentTypes= [dict(CFBundleTypeExtensions=
> That does seem to allow it to accept all files. What if I did just
> text? There's no way to specify all the possible extensions.
> I've noticed that there is:
> Which I could set to: "kUTTypeText"
> would that do it? And is the ByndleTypeName and
> BundleTypeExtensions an
> AND or OR relationship?
> This is all a bit confusing, as I thought OS-X figured out file types
> from combination of extensions, old Type and creator codes, and the
> "file" utility. I that case, couldn't I just set a Mime-type or
> something, and let the OS (or is the Finder?) figure out extensions,
> etc. Is that what CFBundleTypeName does?
> Is there anything else I should do?
> This is a wxPython App, by the way but I don't think that effects this
> Christopher Barker, Ph.D.
> 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
> Pythonmac-SIG maillist - Pythonmac-SIG at python.org
More information about the Pythonmac-SIG