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
|
w <- gwindow("slider, spinbutton", visible=FALSE)
g <- ggroup(cont = w, horiz = FALSE)
## slider
sl <- gslider(from=0, to = 100, by =1, value=50, cont = g)
## svalue
print(svalue(sl))
## svalue <-
svalue(sl) <- 75
## handler
addHandlerChanged(sl, function(h,...) print(svalue(h$obj)))
## spinbutton
sb <- gspinbutton(from=0, to = 100, by =1, value=50, cont = g)
## svalue
print(svalue(sb))
## svalue <-
svalue(sb) <- 75
## handler
addHandlerChanged(sb, function(h,...) print(svalue(h$obj)))
visible(w) <- TRUE
|