File: ex-gdialogs.R

package info (click to toggle)
r-cran-gwidgets 0.0-54.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 2,360 kB
  • sloc: sh: 13; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 791 bytes parent folder | download
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

}