# SpinButton (Python)

Marta Maria Casetti
mmcasetti@gmail.com 2012
Obtendo un enteiro ou número en punto flotante desde o usuario.

# SpinButton

Seleccione un número, escribíndoo ou premendo nos botóns -/+!

# Código usado para xerar este exemplo

# Métodos útiles para o widget SpinButton

For an explanation of signals and callback functions, see this page. An example is the `"value-changed"` signal, emitted when the value of the spinbutton changes.

A Gtk.Adjustment is needed to construct the Gtk.SpinButton. This is the representation of a value with a lower and upper bound, together with step and page increments, and a page size, and it is constructed as `Gtk.Adjustment(value, lower, upper, step_increment, page_increment, page_size)` where the fields are of type `float`; `step_increment` is the increment/decrement that is obtained by using the cursor keys or the buttons of the spinbutton. Note that `page_increment` and `page_size` are not used in this case, and they should be set to `0`.

If you want the value of the spinbutton to wrap around when they exceed the maximum or the minimum, set `set_wrap(True)`. The `"wrapped"` signal is emitted when this happens.

`set_digits(digits)` sets the precision to be displayed by the spinbutton, up to 20 digits.

To get the value of the spinbutton as an integer, use `get_value_as_int()`.

# API References

Neste exemplo empregaremos o seguinte:

GtkSpinButton

GtkAdjustment