inst/tests/ex-gslider-gspinbutton.R

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

Try the gWidgets package in your browser

Any scripts or data that you put into this service are public.

gWidgets documentation built on May 2, 2019, 6:22 p.m.