| gslider {gWidgets} | R Documentation |
The gslider widget and gspinbutton widget allow the user to select a value from a sequence using the mouse. In the slider case, a slider is dragged left or right (or up or down) to change the value. For a spin button a text box with arrows beside allow the user to scroll through the values by clicking the arrows.
gslider(from = 0, to = 100, by = 1, value = from, horizontal = TRUE, handler = NULL, action = NULL, container = NULL, ..., toolkit = guiToolkit())
gspinbutton (from = 0, to = 10, by = 1, value = from, digits = 0,
handler = NULL, action = NULL, container = NULL, ..., toolkit = guiToolkit())
from |
Starting point in range |
to |
Ending point in range |
by |
Step size between values in the sequence |
value |
The initial value |
digits |
The number of digits shown |
horizontal |
Specifies orientation of gslider widget |
handler |
Called on a change event. |
action |
Passed to handler |
container |
Optional container to attach widget to |
... |
ignored |
toolkit |
Which GUI toolkit to use |
The svalue method returns the selected value.
The svalue<- method is used to set the selected value.
The addhandlerchanged handler is called when the
widgets' value is changed.
## Not run:
x = rnorm(100)
plotHist = function(shade = .5) hist(x, col=gray(shade))
group = ggroup(horizontal =FALSE, container=TRUE)
glabel("Slide value to adjust shade", container=group)
gslider(from=0,to=1,by=0.05,value=.5, container=group,
handler=function(h,...) plotHist(svalue(h$obj)))
## End(Not run)