dialog.setvalues(dialog, ids=<<see below>>, values=<<see below>>) dialog.reset(dialog, ids)
dialog
, as returned by the
dialog.create
function.
values
argument as supplied to the
original
dialog.create
function call.
dialog.create
call. The new values are converted to usable values, if necessary. For
widgets with minimum or maximum values, the value is changed to the
nearest range endpoint if it is out of range. For exclusive choice widgets
(like
pulldown
,
radiobox
,
list
), abbreviations are used. If there is
no exact match for the specified value, the first choice for which the value
is an abbreviation is used.
values
list.
The
dialog.reset
function is just a shorthand for specifying
dialog.setvalues
with no
values
argument.
state.dialog <- dialog.create (list(State=dimnames(state.x77)[[1]], Statistic=dimnames(state.x77)[[2]], Value=state.x77[[1,1]]), widgets=c('list', '', 'textfield'), buttons=c('OK','Reset')) dialog.popup (state.dialog) dialog.setvalues (state.dialog, c(1,3), list('Washing', state.x77[['Washington',1]])) button <- dialog.getbutton (state.dialog) if(button == 'OK') { new.state <- unlist(dialog.getvalues(state.dialog,1)) new.stat <- unlist(dialog.getvalues(state.dialog,2)) dialog.setvalues (state.dialog, 3, state.x77[[new.state, new.stat]]) } else if(button == 'Reset') dialog.reset(state.dialog)