~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/tksci/tk_getfile.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function p=tk_getfile(file_mask,path,title,foo)
 
2
  if ~with_tk() then error('Tcl/Tk interface not defined'),end
 
3
  arg=''
 
4
  if exists('file_mask','local')==1 then 
 
5
    TK_SetVar("ftypes",'{""Requested Extensions"" {'+file_mask+'} }')
 
6
    arg=arg+' -filetypes $ftypes'
 
7
  end
 
8
  if exists('path','local')==1 then 
 
9
        if MSDOS then
 
10
                path=pathconvert(path,%f,%t,'w')
 
11
                path=strsubst(path,"\","/")
 
12
                if strindex(path,' ')<>[] then
 
13
                        path='""'+path+'""'
 
14
                        arg=arg+' -initialdir '+path
 
15
                else
 
16
                        arg=arg+' -initialdir  ""'+path +'""'
 
17
                end
 
18
        else
 
19
                path=pathconvert(path,%f,%t)
 
20
                if strindex(path,' ')<>[] then path='""'+path+'""',end
 
21
                arg=arg+' -initialdir  ""'+path +'""'
 
22
        end
 
23
  else
 
24
        if MSDOS then
 
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 +'""'
 
29
                end
 
30
        end
 
31
  end
 
32
  if exists('title','local')==1 then 
 
33
    arg=arg+' -title ""'+title+'""',
 
34
  end
 
35
  TK_EvalStr('set scifilepath [tk_getOpenFile'+arg+']')
 
36
  p=TK_GetVar('scifilepath')
 
37
  if MSDOS then
 
38
        if ~( p=='' ) then
 
39
                global %tk_getfile_defaultpath;
 
40
                %tk_getfile_defaultpath=dirname(p);
 
41
        end
 
42
  end
 
43
endfunction