graphIt <- function(n, ...) hist(rnorm(n))
dlg <- aDialog(items=list(n=integerItem(10), out=graphicDeviceItem()),
model_value_changed=function(.) do.call("graphIt", .$to_R()) ## ... allows out to pass in unnoticed
)
## Not run: dlg$make_gui()
# graphIt(dlg$get_n()) ## initial graphic
# ## End(Not run)
Run the code above in your browser using DataLab