File: test-gradio.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 (26 lines) | stat: -rw-r--r-- 476 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
test.gradio <- function() {
  w <- gwindow()
  g <- ggroup(cont = w, horiz = FALSE)

  items <- letters[1:4]
  
  l <- gradio(items, selected=1, cont = g)
  
  ## svalue
  checkEquals(svalue(l), items[1])
  checkEquals(svalue(l, index=TRUE), 1)

  ## svalue<-
  svalue(l) <- "b"
  checkEquals(svalue(l), "b")

  svalue(l, index=TRUE) <- 3
  checkEquals(svalue(l, index=TRUE), 3)

  ## [
  checkEquals(l[], items)

  ## [<-
  l[] <- items[1:4]
  checkEquals(l[], items[1:4])
}