summaryrefslogtreecommitdiffstats
path: root/xlib
Commit message (Expand)AuthorAgeFilesLines
* *** macosx-8-4-branch merged into the mainline [tcl patch #602770] ***macosx_8_4_merge_2002_08_31_trunkdas2002-08-315-764/+778
* minor cast fixes to prevent 64bit warningshobbs2001-09-211-2/+2
* made XID __int64 type for Win64hobbs2001-09-211-0/+4
* * generic/tkFileFilter.c (AddClause): Cast to match function prototype.mo2000-07-061-2/+2
* * tests/color.test:hobbs2000-03-021-7/+10
* * xlib/xgc.c: #def'd out XDrawSegments for the Mac, and addedhobbs2000-02-101-1/+6
* added recognition of tiling in GChobbs1999-12-141-3/+190
* * xlib/X11/Xlib.h: Remove XFillRectangle since it is now in theredman1999-07-311-13/+0
* modified files to work with new windows Makefilessurles1999-06-161-13/+0
* * generic/tkIntXlibDecls.h:stanton1999-06-021-0/+4
* merge with 8.1.0 branchredman1999-04-211-1/+1
* * Merged 8.1 branch into the main trunkstanton1999-04-165-100/+10
* Merge changes in 8.1 into 8.0.6, specifically we should be exportingredman1999-03-101-11/+0
* integrated stubs into 8.0 main branchstanton1999-03-102-3013/+11
* Replaced SCCS strings, fixed binary filesstanton1998-09-146-6/+6
* Eliminated XReadBitmapFile emulationwelch1998-08-041-49/+5
* New Windows keysymdef.hwelch1998-07-061-0/+5
* Initial revisionrjohnson1998-04-0114-0/+8915
ialog.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacDialog.c,v 1.5 2000/04/17 02:16:50 jingham Exp $
+ * RCS: @(#) $Id: tkMacDialog.c,v 1.6 2000/04/23 03:47:24 jingham Exp $
*/
#include <Gestalt.h>
@@ -305,11 +305,15 @@ Tk_GetOpenFileObjCmd(
AEDesc initialDesc = {typeNull, NULL};
FSSpec dirSpec;
static char *openOptionStrings[] = {
- "-filetypes", "-initialdir", "-message", "-multiple",
+ "-defaultextension", "-filetypes",
+ "-initialdir", "-initialfile",
+ "-message", "-multiple",
"-parent", "-title", NULL
};
enum openOptions {
- OPEN_TYPES, OPEN_INITDIR, OPEN_MESSAGE, OPEN_MULTIPLE,
+ OPEN_DEFAULT, OPEN_TYPES,
+ OPEN_INITDIR, OPEN_INITFILE,
+ OPEN_MESSAGE, OPEN_MULTIPLE,
OPEN_PARENT, OPEN_TITLE
};
@@ -349,6 +353,8 @@ Tk_GetOpenFileObjCmd(
}
switch (index) {
+ case OPEN_DEFAULT:
+ break;
case OPEN_TYPES:
choice = Tcl_GetStringFromObj(objv[i + 1], NULL);
if (TkGetFileFilters(interp, &ofd.fl, choice, 0)
@@ -365,6 +371,8 @@ Tk_GetOpenFileObjCmd(
goto end;
}
break;
+ case OPEN_INITFILE:
+ break;
case OPEN_MESSAGE:
choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
Tcl_UtfToExternal(NULL, NULL, choice, choiceLen,
@@ -898,7 +906,17 @@ NavServicesGetFile(
openFileEventUPP, NULL, NULL);
}
- theResult = Tcl_NewListObj(0, NULL);
+
+ /*
+ * Most commands assume that the file dialogs return a single
+ * item, not a list. So only build a list if multiple is true...
+ */
+
+ if (multiple) {
+ theResult = Tcl_NewListObj(0, NULL);
+ } else {
+ theResult = Tcl_NewObj();
+ }
if ( theReply.validRecord && err == noErr ) {
AEDesc resultDesc;
@@ -921,9 +939,15 @@ NavServicesGetFile(
&length, &pathHandle);
HLock(pathHandle);
Tcl_ExternalToUtfDString(NULL, (char *) *pathHandle, -1, &fileName);
- Tcl_ListObjAppendElement(interp, theResult,
- Tcl_NewStringObj(Tcl_DStringValue(&fileName),
- Tcl_DStringLength(&fileName)));
+ if (multiple) {
+ Tcl_ListObjAppendElement(interp, theResult,
+ Tcl_NewStringObj(Tcl_DStringValue(&fileName),
+ Tcl_DStringLength(&fileName)));
+ } else {
+ Tcl_SetStringObj(theResult, Tcl_DStringValue(&fileName),
+ Tcl_DStringLength(&fileName));
+ }
+
Tcl_DStringFree(&fileName);
HUnlock(pathHandle);
DisposeHandle(pathHandle);
diff --git a/mac/tkMacMenus.c b/mac/tkMacMenus.c