summaryrefslogtreecommitdiffstats
path: root/mac/tkMacMenus.c
diff options
context:
space:
mode:
authorjingham <jingham>2000-04-23 03:47:13 (GMT)
committerjingham <jingham>2000-04-23 03:47:13 (GMT)
commit5de78d21c1372cc6afdd12a2dc56b4909ad3a505 (patch)
tree80482fd73a69139e652624000f1c33ca6f129f2a /mac/tkMacMenus.c
parentc1eb29d0bb103e5f44b45ae8d13803ccb0921b41 (diff)
downloadtk-5de78d21c1372cc6afdd12a2dc56b4909ad3a505.zip
tk-5de78d21c1372cc6afdd12a2dc56b4909ad3a505.tar.gz
tk-5de78d21c1372cc6afdd12a2dc56b4909ad3a505.tar.bz2
2000-04-22 Jim Ingham <jingham@cygnus.com> * mac/tkMacDialog.c (Tk_MacGetOpenFile): Add empty bodies for the "-initialfile" and "-defaultextension" options. * mac/tkMacDialog.c (NavServicesGetFile): Only cons the result up into a list if multiple is true. * mac/tkMacMenus.c (SourceDialog): Use the "tk_getOpenFile" instead of hand-coding the dialog with StandardGetFile. This way we get the Navigation dialogs for free. * doc/getOpenFile.n: Document the -multiple and -message flags which are only implemented on the Mac. Also note that the -title works on the Mac with Nav Services installed.
Diffstat (limited to 'mac/tkMacMenus.c')
-rw-r--r--mac/tkMacMenus.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/mac/tkMacMenus.c b/mac/tkMacMenus.c
index 2230f7a..f83e49d 100644
--- a/mac/tkMacMenus.c
+++ b/mac/tkMacMenus.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacMenus.c,v 1.5 2000/02/10 08:56:03 jingham Exp $
+ * RCS: @(#) $Id: tkMacMenus.c,v 1.6 2000/04/23 03:47:32 jingham Exp $
*/
#include "tcl.h"
@@ -329,29 +329,26 @@ GenerateEditEvent(
static void
SourceDialog()
{
- StandardFileReply reply;
- OSType fileTypes[1];
- OSErr err;
- int length, result;
- Handle path;
+ int result;
+ char *path;
+ char openCmd[] = "tk_getOpenFile -filetypes {\
+ {{TCL Scripts} {.tcl} TEXT} {{Text Files} {} TEXT}}";
if (gInterp == NULL) {
return;
}
- fileTypes[0] = 'TEXT';
- StandardGetFile(NULL, 1, fileTypes, &reply);
- if (reply.sfGood == false) {
+ if (Tcl_Eval(gInterp, openCmd) != TCL_OK) {
return;
}
- err = FSpPathFromLocation(&reply.sfFile, &length, &path);
- if (err == noErr) {
- HLock(path);
- result = Tcl_EvalFile(gInterp, *path);
- HUnlock(path);
- DisposeHandle(path);
+ path = Tcl_GetStringResult(gInterp);
+
+ if (strlen(path) == 0) {
+ return;
}
+
+ result = Tcl_EvalFile(gInterp, path);
if (result == TCL_ERROR) {
Tcl_BackgroundError(gInterp);
}