diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-08-14 12:22:56 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-08-14 12:22:56 (GMT) |
commit | d5d5f462f9a8ff6f2d0e982c3c7f3fff3b683dcf (patch) | |
tree | d9b8a107c57cb0316d5e9073dd7fe9a78cb9b6dd /Mac/Modules/macfsmodule.c | |
parent | 9c45a6504fbc828ed37778674b9ccabae27ae543 (diff) | |
download | cpython-d5d5f462f9a8ff6f2d0e982c3c7f3fff3b683dcf.zip cpython-d5d5f462f9a8ff6f2d0e982c3c7f3fff3b683dcf.tar.gz cpython-d5d5f462f9a8ff6f2d0e982c3c7f3fff3b683dcf.tar.bz2 |
Added new call PromptGetFile (like StandardGetFile, but accepts a
prompt) and added optional prompt to GetDirectory.
Diffstat (limited to 'Mac/Modules/macfsmodule.c')
-rw-r--r-- | Mac/Modules/macfsmodule.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c index 03580b0..4d41f25 100644 --- a/Mac/Modules/macfsmodule.c +++ b/Mac/Modules/macfsmodule.c @@ -652,6 +652,31 @@ mfs_StandardGetFile(self, args) } static object * +mfs_PromptGetFile(self, args) + object *self; /* Not used */ + object *args; +{ + SFTypeList list; + short numtypes; + StandardFileReply reply; + char *prompt = NULL; + + list[0] = list[1] = list[2] = list[3] = 0; + numtypes = 0; + if (!newgetargs(args, "s|O&O&O&O&", &prompt, PyMac_GetOSType, &list[0], + PyMac_GetOSType, &list[1], PyMac_GetOSType, &list[2], + PyMac_GetOSType, &list[3]) ) + return NULL; + while ( numtypes < 4 && list[numtypes] ) { + numtypes++; + } + if ( numtypes == 0 ) + numtypes = -1; + PyMac_PromptGetFile(numtypes, list, &reply, prompt); + return mkvalue("(Oi)", newmfssobject(&reply.sfFile), reply.sfGood); +} + +static object * mfs_StandardPutFile(self, args) object *self; /* Not used */ object *args; @@ -724,11 +749,12 @@ mfs_GetDirectory(self, args) { FSSpec fsdir; int ok; + char *prompt = NULL; - if (!newgetargs(args, "") ) + if (!newgetargs(args, "|s", &prompt) ) return NULL; - ok = PyMac_GetDirectory(&fsdir); + ok = PyMac_GetDirectory(&fsdir, prompt); return mkvalue("(Oi)", newmfssobject(&fsdir), ok); } @@ -767,6 +793,7 @@ mfs_FInfo(self, args) static struct methodlist mfs_methods[] = { {"ResolveAliasFile", mfs_ResolveAliasFile, 1}, {"StandardGetFile", mfs_StandardGetFile, 1}, + {"PromptGetFile", mfs_PromptGetFile, 1}, {"StandardPutFile", mfs_StandardPutFile, 1}, {"GetDirectory", mfs_GetDirectory, 1}, {"FSSpec", mfs_FSSpec, 1}, |