R/tcltk.r

Defines functions helpFunc mytkrplot

# modified tkrplot from file tkrplot
# the parent of the plot depends on type of the plot (2/3 dimensional) and the situation it is called in (extract images
# or plot)
mytkrplot <- function(parent, fun, hscale=1, vscale=1,slicenr=-1,which="unset",parent2=list(),typeV=2,overview=FALSE) {
    if (!overview) if (typeV == 2) parent = parent2  
    # ACHTUNG aenderung, bisher nur in vied2dNew benutzt!!
    image <- paste("Rplot", tkrplot::.make.tkindex(), sep="")
    tkrplot::.my.tkdev(hscale, vscale)
    try(fun())
    tcltk::.Tcl(paste("image create Rplot", image))
    lab<-tcltk::tklabel(parent,image=image) #**** use try, delete image on failure
    tcltk::tkbind(lab,"<Destroy>", function() tcltk::.Tcl(paste("image delete", image)))
    lab$image <- image
    lab$fun <- fun
    lab$hscale <- hscale
    lab$vscale <- vscale
    lab
}
helpFunc <- function(a){
  a <- tcltk::tclVar()
}
neuroconductor/fmri documentation built on May 20, 2021, 4:28 p.m.