Le samedi 28 février 2015 à 06:58 -0800, Eric S a écrit :
> Milan,
>
>
>
> My problem was a semicolon instead of a comma in the call to
> tcl("tk_getOpenFile", args). The function now seems to work. I can
> work up versions for GetSaveFile and ChooseDirectory. Once they seem
> to work, what is the process for suggesting they be included in the Tk
> package?
You can open a pull request against that package.
Before that, I think you should change
filetypes::Array=[]
to
filetypes::Vector=[]
(or even
function GetOpenFile{S<:String}(; filetypes::Vector{S}=String[]
so that it is clear that a vector of strings is expected)
and change
multiple=false
to
multiple::Bool=false
Regards
> function GetOpenFile2(; filetypes::Array=[], initialdir::String="",
> initialfile::String="", multiple=false,
> title::String="")
> args = Dict()
> if length(filetypes) > 0 args["filetypes"] = filetypes end
> if length(initialdir) > 0 args["initialdir"] = initialdir end
> if length(initialfile) > 0 args["initialfile"] = initialfile end
> args["multiple"] = multiple
> if length(title) > 0 args["title"] = title end
> tcl("tk_getOpenFile", args)
> end
>
>
> In [46]:
>
>
> GetOpenFile2(filetypes=["{Text files} {.txt}","{CSV files} {.csv}"],
> title="Select File",initialdir="/Users/ericshain/Documents/")
>
>
>
> Out[46]:
> "/Users/ericshain/Documents/MATLAB/Test
> Data/CMV/11910_FP_PCR_3192010135222_MC.csv"
>
>