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
)
dlg$make_gui()
graphIt(dlg$get_n()) ## initial graphicRun the code above in your browser using DataLab