Spinbutton constructor
A spinbutton allows the user to select from a pre-selected range
of numbers. Similar to a slider, but with more precision, but
slower to adjust. The basic arguments mirror that of seq.int
.
generic for toolkit dispatch
gspinbutton(from = 0, to = 10, by = 1, length.out = NULL, along.with = NULL, value = from, digits = 0, handler = NULL, action = NULL, container = NULL, ..., toolkit = guiToolkit()) .gspinbutton(toolkit, from = 0, to = 10, by = 1, value = from, digits = 0, handler = NULL, action = NULL, container = NULL, ...)
from |
from value |
to |
to value |
by |
step length |
length.out |
number of steps. Only one of |
along.with |
Take from |
value |
initial value |
digits |
number of digits to display, should the toolkit support it |
handler |
A handler assigned to the default change
signal. Handlers are called when some event triggers a widget to
emit a signal. For each widget some default signal is assumed, and
handlers may be assigned to that through Handlers may also be added via |
action |
User supplied data passed to the handler when it is called |
container |
A parent container. When a widget is created it can be incorporated into the widget heirarchy by passing in a parent container at construction time. (For some toolkits this is not optional, e.g. gWidgets2tcltk or gWidgets2WWW2.) |
... |
These values are passed to the |
toolkit |
Each widget constructor is passed in the toolkit it
will use. This is typically done using the default, which will
lookup the toolkit through |
if(interactive()) { ## a range widget uses either a slider or a linked spinbutton to select a value w <- gwindow("Range widget", visible=FALSE) g <- ggroup(cont=w, horizontal=TRUE) sl <- gslider(from=0, to=100, by=1, value=0, cont=g, expand=TRUE, fill="both") sp <- gspinbutton(from=0, to=100, by=1, value=0, cont=g) ## Two ways to do this: ## addHandlerChanged(sl, function(...) svalue(sp) <- svalue(sl)) ## addHandlerChanged(sp, function(...) svalue(sl) <- svalue(sp)) f <- function(h, ...) svalue(h$action) <- svalue(h$obj) addHandlerChanged(sl, f, action=sp) addHandlerChanged(sp, f, action=sl) visible(w) <- TRUE }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.