Skip to content

Commit

Permalink
Merge pull request #141 from sgsokol/custom_dialogs
Browse files Browse the repository at this point in the history
added customization to file dialogs
  • Loading branch information
aviks committed Feb 5, 2020
2 parents 309c485 + c31f661 commit 312cf01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ function to_tcl(x::Function)
perc_args = join(map(u -> "%$(string(u))", args[2:end]), " ")
cmd = "{$ccb $perc_args}"
end
function to_tcl(x::Tuple)
out = filter(item -> item != nothing, x)
"{"*join(["$(to_tcl(item))" for item in out], " ")*"}"
end

## Function to simplify call to tcl_eval, ala R's tcl() function
## converts argumets through to_tcl
Expand Down
6 changes: 3 additions & 3 deletions src/dialogs.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## dialogs

## can add arguments if desired. Don't like names or lack of arguments
GetOpenFile() = tcl("tk_getOpenFile")
GetSaveFile() = tcl("tk_getSaveFile")
ChooseDirectory() = tcl("tk_chooseDirectory")
GetOpenFile(;kwargs...) = tcl("tk_getOpenFile";kwargs...)
GetSaveFile(;kwargs...) = tcl("tk_getSaveFile";kwargs...)
ChooseDirectory(;kwargs...) = tcl("tk_chooseDirectory";kwargs...)

## Message box
function Messagebox(parent::MaybeWidget; title::AbstractString="", message::AbstractString="", detail::AbstractString="")
Expand Down

0 comments on commit 312cf01

Please sign in to comment.