Adding windows example files

This commit is contained in:
Roland Hollós 2018-11-20 01:42:30 +01:00
parent 34c2089c4b
commit 2951c13b04
3 changed files with 14 additions and 5 deletions

View File

@ -20,7 +20,7 @@ copyMusoExamleTo <- function(example = NULL, destination = NULL){
choiceValues <- basename(list.dirs(system.file("examples","",package = "RBBGCMuso"),recursive = FALSE)) choiceValues <- basename(list.dirs(system.file("examples","",package = "RBBGCMuso"),recursive = FALSE))
choices <- tcltk::tkwidget(choiceWin,"ComboBox", choices <- tcltk::tkwidget(choiceWin,"ComboBox",
editable = FALSE, values = choiceValues, editable = FALSE, values = choiceValues,
textvariable = tclVar(choiceValues[1])) textvariable = tcltk::tclVar(choiceValues[1]))
tkpack(choices) tkpack(choices)
choiceValue <- NA choiceValue <- NA
closeSelection <- tcltk::tkwidget(choiceWin,"button",text ="Select", command =function (){ closeSelection <- tcltk::tkwidget(choiceWin,"button",text ="Select", command =function (){
@ -38,15 +38,24 @@ copyMusoExamleTo <- function(example = NULL, destination = NULL){
if(is.null(example)){ if(is.null(example)){
cExample<-chooseExample() cExample<-paste0(system.file("examples","",package = "RBBGCMuso"),chooseExample())
} }
if(is.null(destination)){ if(is.null(destination)){
destination<-tcltk::tk_choose.dir(getwd(), "Choose folder to copy the examples!") destination<-tcltk::tk_choose.dir(getwd(), "Choose folder to copy the examples!")
} }
return(c(cExample,destination))
currDir <- getwd()
setwd(cExample)
print(getwd())
if(!WindowsP){
file.copy("./bin/muso", destination)
} else {
file.copy("./bin/muso.exe", destination)
file.copy("./bin/cygwin.dll")
}
file.copy(grep("bin", list.files(), value = TRUE, invert = TRUE),destination)
setwd(currDir)
} }
## choiceWin <- tcltk::tktoplevel() ## choiceWin <- tcltk::tktoplevel()
## tclRequire("BWidget") ## tclRequire("BWidget")

Binary file not shown.

Binary file not shown.