Adw.SpinRow¶
- Subclasses:
None
Methods¶
- Inherited:
Adw.ActionRow (17), Adw.PreferencesRow (9), Gtk.ListBoxRow (12), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Actionable (5), Gtk.Editable (27)
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Adw.ActionRow (6), Adw.PreferencesRow (4), Gtk.ListBoxRow (3), Gtk.Widget (34), Gtk.Accessible (1), Gtk.Actionable (2), Gtk.Editable (8)
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Adw.ActionRow (1), Gtk.ListBoxRow (1), Gtk.Widget (13), GObject.Object (1), Gtk.Editable (3)
Name |
Short Description |
---|---|
Emitted to convert the user’s input into a double value. |
|
Emitted to tweak the formatting of the value for display. |
|
Emitted right after the spinbutton wraps. |
Fields¶
Class Details¶
- class Adw.SpinRow(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An [class`ActionRow`] with an embedded spin button.
<picture> <source srcset=”spin-row-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”spin-row.png” alt=”spin-row”> </picture>
Example of an
AdwSpinRow
UI definition:``xml <object class=”AdwSpinRow”>
<property name=”title” translatable=”yes”>Spin Row</property> <property name=”adjustment”>
- <object class=”GtkAdjustment”>
<property name=”lower”>0</property> <property name=”upper”>100</property> <property name=”value”>50</property> <property name=”page-increment”>10</property> <property name=”step-increment”>1</property>
</object>
</property>
</object> ``
See [class`Gtk`.SpinButton] for details.
- CSS nodes
AdwSpinRow
has the same structure as [class`ActionRow`], as well as the.spin
style class on the main node.New in version 1.4.
- classmethod new(adjustment, climb_rate, digits)¶
- Parameters:
adjustment (
Gtk.Adjustment
orNone
) – the adjustment that this spin row should useclimb_rate (
float
) – the rate the value changes when holding a button or keydigits (
int
) – the number of decimal places to display
- Returns:
the newly created
AdwSpinRow
- Return type:
Creates a new
AdwSpinRow
.New in version 1.4.
- classmethod new_with_range(min, max, step)¶
- Parameters:
- Returns:
the new
AdwSpinRow
- Return type:
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 [method`SpinRow`.set_digits] to correct it.
New in version 1.4.
- configure(adjustment, climb_rate, digits)¶
- Parameters:
adjustment (
Gtk.Adjustment
orNone
) – the adjustment that this spin row should useclimb_rate (
float
) – the new climb ratedigits (
int
) – the number of decimal places to display
Changes the properties of an existing spin row.
The adjustment, climb rate, and number of decimal places are updated accordingly.
New in version 1.4.
- get_adjustment()¶
- Returns:
the adjustment that holds the spin row’s value
- Return type:
Gets the adjustment that holds the value for the spin row.
New in version 1.4.
- get_climb_rate()¶
- Returns:
the acceleration rate when you hold down a button or key
- Return type:
Gets the acceleration rate when you hold down a button or key.
New in version 1.4.
- get_digits()¶
- Returns:
the number of decimal places to display
- Return type:
Gets the number of decimal places to display.
New in version 1.4.
- get_numeric()¶
- Returns:
whether non-numeric characters should be ignored.
- Return type:
Gets whether non-numeric characters should be ignored.
New in version 1.4.
- get_snap_to_ticks()¶
- Returns:
whether invalid values are snapped to the nearest step increment
- Return type:
Gets whether invalid values are snapped to nearest step increment.
New in version 1.4.
- get_update_policy()¶
- Returns:
the policy for updating the spin row
- Return type:
Gets the policy for updating the spin row.
New in version 1.4.
- get_value()¶
- Returns:
the current value
- Return type:
Gets the current value.
New in version 1.4.
- get_wrap()¶
- Returns:
whether the spin row should wrap upon reaching its limits
- Return type:
Gets whether the spin row should wrap upon reaching its limits.
New in version 1.4.
- set_adjustment(adjustment)¶
- Parameters:
adjustment (
Gtk.Adjustment
orNone
) – an adjustment
Sets the adjustment that holds the value for the spin row.
New in version 1.4.
- set_climb_rate(climb_rate)¶
- Parameters:
climb_rate (
float
) – the acceleration rate when you hold down a button or key
Sets the acceleration rate when you hold down a button or key.
New in version 1.4.
- set_digits(digits)¶
- Parameters:
digits (
int
) – the number of decimal places to display
Sets the number of decimal places to display.
New in version 1.4.
- set_numeric(numeric)¶
- Parameters:
numeric (
bool
) – whether non-numeric characters should be ignored
Sets whether non-numeric characters should be ignored.
New in version 1.4.
- set_range(min, max)¶
-
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.
New in version 1.4.
- set_snap_to_ticks(snap_to_ticks)¶
- Parameters:
snap_to_ticks (
bool
) – whether invalid values are snapped to the nearest step increment
Sets whether invalid values are snapped to the nearest step increment.
New in version 1.4.
- set_update_policy(policy)¶
- Parameters:
policy (
Gtk.SpinButtonUpdatePolicy
) – the policy for updating the spin row
Sets the policy for updating the spin row.
The options are always, or only when the value is invalid.
New in version 1.4.
- set_value(value)¶
- Parameters:
value (
float
) – a new value
Sets the current value.
New in version 1.4.
- set_wrap(wrap)¶
- Parameters:
wrap (
bool
) – whether the spin row should wrap upon reaching its limits
Sets whether the spin row should wrap upon reaching its limits.
New in version 1.4.
- update()¶
Manually force an update of the spin row.
New in version 1.4.
Signal Details¶
- Adw.SpinRow.signals.input(spin_row)¶
- Signal Name:
input
- Flags:
- Parameters:
spin_row (
Adw.SpinRow
) – The object which received the signal- Returns:
TRUE
for a successful conversion,FALSE
if the input was not handled, andGTK_INPUT_ERROR
if the conversion failed.- new_value:
return location for the new value
- Return type:
Emitted to convert the user’s input into a double value.
The signal handler is expected to use [method`Gtk`.Editable.get_text] to retrieve the text of the spinbutton and set new_value to the new value.
The default conversion uses [func`GLib`.strtod].
See [signal`Gtk`.SpinButton::input].
New in version 1.4.
- Adw.SpinRow.signals.output(spin_row)¶
- Signal Name:
output
- Flags:
- Parameters:
spin_row (
Adw.SpinRow
) – The object which received the signal- Returns:
TRUE
if the value has been displayed- Return type:
Emitted to tweak the formatting of the value for display.
See [signal`Gtk`.SpinButton::output].
New in version 1.4.
- Adw.SpinRow.signals.wrapped(spin_row)¶
- Signal Name:
wrapped
- Flags:
- Parameters:
spin_row (
Adw.SpinRow
) – The object which received the signal
Emitted right after the spinbutton wraps.
See [signal`Gtk`.SpinButton::wrapped].
New in version 1.4.
Property Details¶
- Adw.SpinRow.props.adjustment¶
- Name:
adjustment
- Type:
- Default Value:
- Flags:
The adjustment that holds the value of the spin row.
New in version 1.4.
- Adw.SpinRow.props.climb_rate¶
- Name:
climb-rate
- Type:
- Default Value:
0.0
- Flags:
The acceleration rate when you hold down a button or key.
New in version 1.4.
- Adw.SpinRow.props.digits¶
- Name:
digits
- Type:
- Default Value:
0
- Flags:
The number of decimal places to display.
New in version 1.4.
- Adw.SpinRow.props.numeric¶
- Name:
numeric
- Type:
- Default Value:
- Flags:
Whether non-numeric characters should be ignored.
New in version 1.4.
- Adw.SpinRow.props.snap_to_ticks¶
- Name:
snap-to-ticks
- Type:
- Default Value:
- Flags:
Whether invalid values are snapped to the nearest step increment.
New in version 1.4.
- Adw.SpinRow.props.update_policy¶
- Name:
update-policy
- Type:
- Default Value:
- Flags:
The policy for updating the spin row.
The options are always, or only when the value is invalid.
New in version 1.4.
- Adw.SpinRow.props.value¶
- Name:
value
- Type:
- Default Value:
0.0
- Flags:
The current value.
New in version 1.4.