R/controls.R

##' @include manipulate.R
NULL

## Class for holding controls
ManipulateControls <- setRefClass("ManipulateControls",
                                  fields=list(
                                    l="list",
                                    widget = "ANY",
                                    label="character",
                                    initial="ANY"
                                    ),
                                  methods = list(
                                    initialize=function(l=list(), label="", initial=NULL) {
                                      initFields(l=l, label=label, initial=initial)
                                      callSuper()
                                    },
                                    validate_inputs = function(...) {
                                      "Validate input code"
                                    },
                                    get_value=function(...) {
                                      "Get value of widget"
                                      svalue(widget)
                                    },
                                    make_gui=function(cont, handler) {
                                      "Create widget, then add to table"
                                      w <- widget
                                      svalue(w) <- initial
                                      addHandlerChanged(w, handler=handler)
                                    }
                                    ))

Try the gWidgetsManipulate package in your browser

Any scripts or data that you put into this service are public.

gWidgetsManipulate documentation built on May 2, 2019, 5:26 p.m.