File: test-gbutton.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 (34 lines) | stat: -rw-r--r-- 612 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
test.gbutton <- function() {
  w <- gwindow()
  g <- ggroup(cont = w, horiz = FALSE)
  
  text <- "label text"; newText <- "quit"
  
  ## plain vanilla
  l <- gbutton(text, cont = g)
  
  ## svalue
  checkEquals(svalue(l), text)
  
  ## svalue<-
  svalue(l) <- newText
  checkEquals(svalue(l), newText)
  
  ## font<-
  font(l) <- c(weight="bold", color="red")

  # gaction
  a <- gaction(text, handler = function(h,...) print("hi"))
  l <- gbutton(action = a, cont =g)

  checkEquals(svalue(a), text)


  ## enabled
  b <- gbutton("asdf", cont=g)
  enabled(b) <- FALSE
  checkEquals(enabled(b), FALSE)
  

  
}