:right-sidebar: True SpinRow =================================================================== .. currentmodule:: gi.repository.Adw .. versionadded:: 1.4 .. class:: SpinRow(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Adw.ActionRow`, :class:`~gi.repository.Adw.PreferencesRow`, :class:`~gi.repository.Gtk.ListBoxRow`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Actionable`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.Editable` An :obj:`~gi.repository.Adw.ActionRow` with an embedded spin button. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/spin-row.png Example of an ``AdwSpinRow`` UI definition: .. code-block:: xml :dedent: Spin Row 0 100 50 10 1 See :obj:`~gi.repository.Gtk.SpinButton` for details. CSS nodes -------------------------------------------------------------------------------- ``AdwSpinRow`` has the same structure as :obj:`~gi.repository.Adw.ActionRow`\, as well as the ``.spin`` style class on the main node. Accessibility -------------------------------------------------------------------------------- ``AdwSpinRow`` uses an internal ``GtkSpinButton`` with the ``GTK_ACCESSIBLE_ROLE_SPIN_BUTTON`` role. Constructors ------------ .. rst-class:: interim-class .. class:: SpinRow :no-index: .. classmethod:: new(adjustment: ~gi.repository.Gtk.Adjustment | None, climb_rate: float, digits: int) -> ~gi.repository.Gtk.Widget Creates a new ``AdwSpinRow``\. .. versionadded:: 1.4 :param adjustment: the adjustment that this spin row should use :param climb_rate: the rate the value changes when holding a button or key :param digits: the number of decimal places to display .. classmethod:: new_with_range(min: float, max: float, step: float) -> ~gi.repository.Gtk.Widget Creates a new ``AdwSpinRow`` with the given properties. This is a convenience constructor that allows creation of a numeric ``AdwSpinRow`` without manually creating an adjustment. The value is initially set to the minimum value and a page increment of 10 * ``step`` is the default. The precision of the spin row is equivalent to the precisions of ``step``\. ::: note The way in which the precision is derived works best if ``step`` is a power of ten. If the resulting precision is not suitable for your needs, use :obj:`~gi.repository.SpinRow.set_digits` to correct it. .. versionadded:: 1.4 :param min: minimum allowable value :param max: maximum allowable value :param step: increment added or subtracted by spinning the widget Methods ------- .. rst-class:: interim-class .. class:: SpinRow :no-index: .. method:: configure(adjustment: ~gi.repository.Gtk.Adjustment | None, climb_rate: float, digits: int) -> None Changes the properties of an existing spin row. The adjustment, climb rate, and number of decimal places are updated accordingly. .. versionadded:: 1.4 :param adjustment: the adjustment that this spin row should use :param climb_rate: the new climb rate :param digits: the number of decimal places to display .. method:: get_adjustment() -> ~gi.repository.Gtk.Adjustment Gets the adjustment that holds the value for the spin row. .. versionadded:: 1.4 .. method:: get_climb_rate() -> float Gets the acceleration rate when you hold down a button or key. .. versionadded:: 1.4 .. method:: get_digits() -> int Gets the number of decimal places to display. .. versionadded:: 1.4 .. method:: get_numeric() -> bool Gets whether non-numeric characters should be ignored. .. versionadded:: 1.4 .. method:: get_snap_to_ticks() -> bool Gets whether invalid values are snapped to nearest step increment. .. versionadded:: 1.4 .. method:: get_update_policy() -> ~gi.repository.Gtk.SpinButtonUpdatePolicy Gets the policy for updating the spin row. .. versionadded:: 1.4 .. method:: get_value() -> float Gets the current value. .. versionadded:: 1.4 .. method:: get_wrap() -> bool Gets whether the spin row should wrap upon reaching its limits. .. versionadded:: 1.4 .. method:: set_adjustment(adjustment: ~gi.repository.Gtk.Adjustment | None = None) -> None Sets the adjustment that holds the value for the spin row. .. versionadded:: 1.4 :param adjustment: an adjustment .. method:: set_climb_rate(climb_rate: float) -> None Sets the acceleration rate when you hold down a button or key. .. versionadded:: 1.4 :param climb_rate: the acceleration rate when you hold down a button or key .. method:: set_digits(digits: int) -> None Sets the number of decimal places to display. .. versionadded:: 1.4 :param digits: the number of decimal places to display .. method:: set_numeric(numeric: bool) -> None Sets whether non-numeric characters should be ignored. .. versionadded:: 1.4 :param numeric: whether non-numeric characters should be ignored .. method:: set_range(min: float, max: float) -> None Sets the minimum and maximum allowable values for ``self``\. If the current value is outside this range, it will be adjusted to fit within the range, otherwise it will remain unchanged. .. versionadded:: 1.4 :param min: minimum allowable value :param max: maximum allowable value .. method:: set_snap_to_ticks(snap_to_ticks: bool) -> None Sets whether invalid values are snapped to the nearest step increment. .. versionadded:: 1.4 :param snap_to_ticks: whether invalid values are snapped to the nearest step increment .. method:: set_update_policy(policy: ~gi.repository.Gtk.SpinButtonUpdatePolicy) -> None Sets the policy for updating the spin row. The options are always, or only when the value is invalid. .. versionadded:: 1.4 :param policy: the policy for updating the spin row .. method:: set_value(value: float) -> None Sets the current value. .. versionadded:: 1.4 :param value: a new value .. method:: set_wrap(wrap: bool) -> None Sets whether the spin row should wrap upon reaching its limits. .. versionadded:: 1.4 :param wrap: whether the spin row should wrap upon reaching its limits .. method:: update() -> None Manually force an update of the spin row. .. versionadded:: 1.4 Properties ---------- .. rst-class:: interim-class .. class:: SpinRow :no-index: .. attribute:: props.adjustment :type: ~gi.repository.Gtk.Adjustment The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.climb_rate :type: float The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.digits :type: int The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.numeric :type: bool The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.snap_to_ticks :type: bool The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.update_policy :type: ~gi.repository.Gtk.SpinButtonUpdatePolicy The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.value :type: float The type of the None singleton. .. versionadded:: 1.4 .. attribute:: props.wrap :type: bool The type of the None singleton. .. versionadded:: 1.4 Signals ------- .. rst-class:: interim-class .. class:: SpinRow.signals :no-index: .. method:: input() -> ~typing.Tuple[int, float] The type of the None singleton. .. versionadded:: 1.4 .. method:: output() -> bool The type of the None singleton. .. versionadded:: 1.4 .. method:: wrapped() -> None The type of the None singleton. .. versionadded:: 1.4