1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
if(interactive()) {
w <- gwindow("dialogs example", visible=FALSE)
g <- ggroup(cont = w, horizontal = FALSE)
## filebrowse
gfilebrowse("select a file", cont = g)
## calendar
gcalendar("date", cont = g)
## gfile
gbutton("gfile", cont = g, handler = function(...) {
out <- gfile()
print(out)
})
## gmessage
gbutton("gmessage", cont = g, handler = function(h,...) {
gmessage("message", title="title", icon = "warning", parent = h$obj)
})
## gconfirm
gbutton("gconfirm", cont = g, handler = function(h,...) {
out <- gconfirm("confirm", title="title", icon = "warning", parent = h$obj)
print(out)
})
## ginput
gbutton("ginput", cont = g, handler = function(h,...) {
out <- ginput("input", title="title", icon = "warning", parent = h$obj)
print(out)
})
visible(w) <- TRUE
}
|