Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add set_value method

  • Loading branch information...
commit 0451a73722e9bc3b4e98faadb269ab20c91c1d48 1 parent b270ff4
@jverzani authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 R/gformlayout.R
View
9 R/gformlayout.R
@@ -78,6 +78,15 @@ GFormLayout <- setRefClass("GFormLayout",
names(children) <<- c(nms, label)
},
get_value=function(...) sapply(children, svalue, simplify=FALSE),
+ set_value=function(value, ...) {
+ "value a named list matching children"
+ value <- as.list(value)
+ nms <- Filter(function(i) !is.na(match(i, names(children))), names(value))
+ sapply(nms, function(nm) {
+ obj <- children[[nm]]
+ svalue(obj) <- value[[nm]]
+ })
+ },
get_dim=function() {
d <- rev(as.numeric(tcl("grid","size", widget)))
setNames(d, c("nrow", "ncol"))
Please sign in to comment.
Something went wrong with that request. Please try again.