[Pythonmac-SIG] Replacing macfs.StandardGetFile and friends.

Jack Jansen Jack.Jansen@cwi.nl
Fri, 17 Jan 2003 17:16:40 +0100


The calls EasyDialogs.AskFileForOpen(), AskFileForSave() and 
AskFolder() have been implemented in CVS. Please give them a try. 
They've been tested only very lightly, so I could use a helping hand 
here with all the options.

No documentation yet, but the main options are as follows (read the 
source for EasyDialogs.py and Nav.c for details):
- wanted: you can pass a type here telling what you want back. FSSpec, 
FSRef, str or unicode (or subtypes thereof!) are acceptable.
- message: the prompt (only ascii, for now)
- savedFileName: the default output filename (only ascii, for now)
- typeList: a list or tuple of 4-char filetype codes (or the Res.Handle 
data structure Nav really uses)
- defaultLocation: which folder to show the user first (FSSpec, FSRef, 
pathname and AE are acceptable)

The return value is of type "wanted" or None if the user cancelled.

If someone can come up with an example for a filterProc use that would 
be nice.
--
Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman