setWinVal {PBSmodelling} | R Documentation |
Update Widget Values
Description
Update a widget with a new value.
Usage
setWinVal(vars, winName)
Arguments
vars |
a list or vector with named components. |
winName |
window from which to select GUI widget values. The default takes the window that has most recently received new user input. |
Details
The vars
argument expects a list or vector with named elements.
Every element name corresponds to the widget name which will be updated
with the supplied element value.
The vector
, matrix
, and data
widgets can be updated in
several ways. If more than one name is specified for the names
argument
of these widgets, each element is treated like an entry
widget.
If however, a single name
describes any of these three widgets, the entire
widget can be updated by passing an appropriately sized object.
Alternatively, any element can be updated by appending its index in square brackets
to the end of the name
. The data
widget is indexed differently
than the matrix
widget by adding "d" after the brackets. This tweak is necessary
for the internal coding (bookkeeping) of PBS Modelling. Example: "foo[1,1]d"
.
Author(s)
Alex Couture-Beil, Vancouver Island University, Nanaimo BC
See Also
Examples
## Not run:
local(envir=.PBSmodEnv,expr={
winDesc <- c("vector length=3 name=vec",
"matrix nrow=2 ncol=2 name=mat", "slideplus name=foo");
createWin(winDesc, astext=TRUE)
setWinVal(list(vec=1:3, "mat[1,1]"=123, foo.max=1.5, foo.min=0.25, foo=0.7))
})
## End(Not run)