1
function p=tk_getfile(file_mask,path,title,foo)
2
if ~with_tk() then error('Tcl/Tk interface not defined'),end
4
if exists('file_mask','local')==1 then
5
TK_SetVar("ftypes",'{""Requested Extensions"" {'+file_mask+'} }')
6
arg=arg+' -filetypes $ftypes'
8
if exists('path','local')==1 then
10
path=pathconvert(path,%f,%t,'w')
11
path=strsubst(path,"\","/")
12
if strindex(path,' ')<>[] then
14
arg=arg+' -initialdir '+path
16
arg=arg+' -initialdir ""'+path +'""'
19
path=pathconvert(path,%f,%t)
20
if strindex(path,' ')<>[] then path='""'+path+'""',end
21
arg=arg+' -initialdir ""'+path +'""'
25
global %tk_getfile_defaultpath
26
if exists('%tk_getfile_defaultpath','global') == 1 then
27
strsubst(%tk_getfile_defaultpath,'\','/')
28
arg=arg+' -initialdir ""'+%tk_getfile_defaultpath +'""'
32
if exists('title','local')==1 then
33
arg=arg+' -title ""'+title+'""',
35
TK_EvalStr('set scifilepath [tk_getOpenFile'+arg+']')
36
p=TK_GetVar('scifilepath')
39
global %tk_getfile_defaultpath;
40
%tk_getfile_defaultpath=dirname(p);