summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-10-22 10:27:58 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-10-22 10:27:58 (GMT)
commitda76bd4e71a3e8d17bd2b649d285e19a41f834b3 (patch)
treefe5c722a73092bba1b18f4ddcc412eaf45298fd1 /macosx
parent4da8735aec87cdbfff2fe507c403b4a4bf242f2e (diff)
downloadtk-da76bd4e71a3e8d17bd2b649d285e19a41f834b3.zip
tk-da76bd4e71a3e8d17bd2b649d285e19a41f834b3.tar.gz
tk-da76bd4e71a3e8d17bd2b649d285e19a41f834b3.tar.bz2
Deal with [Patch 2168768], so making the -typevariable option work consistently
with global variables (the only way it *can* work...)
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXDialog.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 35af0de..8a51dc2 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.36.2.5 2008/12/07 16:57:44 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.36.2.6 2009/10/22 10:27:58 dkf Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -364,7 +364,8 @@ Tk_GetOpenFileObjCmd(
initialPtr = &initialDesc;
}
if (typeVariablePtr) {
- initialtype = Tcl_GetVar(interp, Tcl_GetString(typeVariablePtr), 0);
+ initialtype = Tcl_GetVar(interp, Tcl_GetString(typeVariablePtr),
+ TCL_GLOBAL_ONLY);
}
result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, &selectDesc,
title, message, initialtype, multiple, OPEN_FILE, parent);
@@ -376,8 +377,11 @@ Tk_GetOpenFileObjCmd(
while (filterPtr && i-- > 0) {
filterPtr = filterPtr->next;
}
- Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), filterPtr ?
- filterPtr->name : "", 0);
+ if (Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr),
+ filterPtr ? filterPtr->name : "",
+ TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
+ result = TCL_ERROR;
+ }
}
end: