diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-10-22 10:27:58 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-10-22 10:27:58 (GMT) |
commit | a58b53c911d2fe5723e82fea17358720b7ed7427 (patch) | |
tree | fe5c722a73092bba1b18f4ddcc412eaf45298fd1 /macosx/tkMacOSXDialog.c | |
parent | 67ddb0f4e538cbf4ef446a51c576f28a3aa10350 (diff) | |
download | tk-a58b53c911d2fe5723e82fea17358720b7ed7427.zip tk-a58b53c911d2fe5723e82fea17358720b7ed7427.tar.gz tk-a58b53c911d2fe5723e82fea17358720b7ed7427.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/tkMacOSXDialog.c')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 12 |
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: |