GtkSpinButton {RGtk2} | R Documentation |
Retrieve an integer or floating-point number from the user
gtkSpinButtonConfigure(object, adjustment = NULL, climb.rate, digits)
gtkSpinButtonNew(adjustment = NULL, climb.rate = NULL, digits = NULL, show = TRUE)
gtkSpinButtonNewWithRange(min, max, step, show = TRUE)
gtkSpinButtonSetAdjustment(object, adjustment)
gtkSpinButtonGetAdjustment(object)
gtkSpinButtonSetDigits(object, digits)
gtkSpinButtonSetIncrements(object, step, page)
gtkSpinButtonSetRange(object, min, max)
gtkSpinButtonGetValueAsInt(object)
gtkSpinButtonSetValue(object, value)
gtkSpinButtonSetUpdatePolicy(object, policy)
gtkSpinButtonSetNumeric(object, numeric)
gtkSpinButtonSpin(object, direction, increment)
gtkSpinButtonSetWrap(object, wrap)
gtkSpinButtonSetSnapToTicks(object, snap.to.ticks)
gtkSpinButtonUpdate(object)
gtkSpinButtonGetDigits(object)
gtkSpinButtonGetIncrements(object)
gtkSpinButtonGetNumeric(object)
gtkSpinButtonGetRange(object)
gtkSpinButtonGetSnapToTicks(object)
gtkSpinButtonGetUpdatePolicy(object)
gtkSpinButtonGetValue(object)
gtkSpinButtonGetWrap(object)
gtkSpinButton(adjustment = NULL, climb.rate = NULL, digits = NULL, min, max, step, show = TRUE)
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkEntry +----GtkSpinButton
GtkSpinButton implements
GtkBuildable
, AtkImplementorIface, GtkCellEditable
and GtkEditable
.
A GtkSpinButton
is an ideal way to allow the user to set the value of some
attribute. Rather than having to directly type a number into a GtkEntry
,
GtkSpinButton
allows the user to click on one of two arrows to increment or
decrement the displayed value. A value can still be typed in, with the bonus
that it can be checked to ensure it is in a given range.
The main properties of a GtkSpinButton
are through a GtkAdjustment
. See the
GtkAdjustment
section for more details about an adjustment's properties.
# Provides a function to retrieve an integer value from a GtkSpinButton # and creates a spin button to model percentage values. grab_int_value <- function(a_spinner, user_data) { return(a_spinner$getValueAsInt()) } create_integer_spin_button <- function() { spinner_adj <- gtkAdjustment(50.0, 0.0, 100.0, 1.0, 5.0, 5.0) window <- gtkWindow("toplevel", show = F) window$setBorderWidth(5) # creates the spinner, with no decimal places spinner <- gtkSpinner(spinner_adj, 1.0, 0) window$add(spinner) window$showAll() }
# Provides a function to retrieve a floating point value from a # GtkSpinButton, and creates a high precision spin button. grab_value <- function(a_spinner, user_data) { return(a_spinner$getValue()) } create_floating_spin_button <- function() { spinner_adj <- gtkAdjustment(2.500, 0.0, 5.0, 0.001, 0.1, 0.1) window <- gtkWindow("toplevel", show = F) window$setBorderWidth(5) # creates the spinner, with three decimal places spinner <- gtkSpinner(spinner_adj, 0.001, 3) window$add(spinner) window$showAll() }
GtkSpinButton
entry
is the GtkEntry
part of the GtkSpinButton
widget, and can be used accordingly. All other fields contain private data
and should only be modified using the functions below.
gtkSpinButton
is the result of collapsing the constructors of GtkSpinButton
(gtkSpinButtonNew
, gtkSpinButtonNewWithRange
) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.
GtkSpinButtonUpdatePolicy
GTK_UPDATE_ALWAYS | When refreshing your GtkSpinButton , the value is always displayed. |
GTK_UPDATE_IF_VALID | When refreshing your GtkSpinButton , the value is only displayed if it is valid within the bounds of the spin button's GtkAdjustment . |
GtkSpinType
GTK_SPIN_STEP_FORWARD, GTK_SPIN_STEP_BACKWARD, GTK_SPIN_PAGE_FORWARD, GTK_SPIN_PAGE_BACKWARD | These values spin a GtkSpinButton by the relevant values of the spin button's GtkAdjustment . |
GTK_SPIN_HOME, GTK_SPIN_END | These set the spin button's value to the minimum or maxmimum possible values, (set by its GtkAdjustment ), respectively. |
GTK_SPIN_USER_DEFINED | The programmer must specify the exact amount to spin the GtkSpinButton . |
The (spinbutton, arg1, user.data)
spinbutton
GtkSpinButton
] the object which received the signal.arg1
GtkScrollType
] user.data
The (spinbutton, arg1, user.data)
spinbutton
GtkSpinButton
] the object which received the signal.arg1
user.data
The (spinbutton, user.data)
spinbutton
GtkSpinButton
] the object which received the signal.user.data
The (spinbutton, user.data)
spinbutton
GtkSpinButton
] the object which received the signal.user.data
The (spinbutton, user.data)
Since 2.10
spinbutton
GtkSpinButton
] the object which received the signaluser.data
adjustment
[GtkAdjustment
: Read / Write]The adjustment that holds the value of the spinbutton.
climb-rate
[numeric : Read / Write]The acceleration rate when you hold down a button. Allowed values: >= 0 Default value: 0
digits
[numeric : Read / Write]The number of decimal places to display. Allowed values: <= 20 Default value: 0
numeric
[logical : Read / Write]Whether non-numeric characters should be ignored. Default value: FALSE
snap-to-ticks
[logical : Read / Write]Whether erroneous values are automatically changed to a spin button's nearest step increment. Default value: FALSE
update-policy
[GtkSpinButtonUpdatePolicy
: Read / Write]Whether the spin button should update always, or only when the value is legal. Default value: GTK_UPDATE_ALWAYS
value
[numeric : Read / Write]Reads the current value, or sets a new value. Default value: 0
wrap
[logical : Read / Write]Whether a spin button should wrap upon reaching its limits. Default value: FALSE
shadow-type
[GtkShadowType
: Read]the type of border that surrounds the arrows of a spin button. Default value: GTK_SHADOW_IN
Derived by RGtkGen from GTK+ documentation
http://developer.gnome.org/doc/API/2.0/gtk/GtkSpinButton.html