SpinRow

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 adw.spin_row.SpinRow UI definition:

<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 gtk.spin_button.SpinButton for details.

CSS nodes

adw.spin_row.SpinRow has the same structure as class@ActionRow, as well as the .spin style class on the main node.

Accessibility

adw.spin_row.SpinRow uses an internal gtk.spin_button.SpinButton with the gtk.types.AccessibleRole.SpinButton role.

Constructors

this
this(gtk.adjustment.Adjustment adjustment, double climbRate, uint digits)

Creates a new adw.spin_row.SpinRow.

Members

Functions

configure
void configure(gtk.adjustment.Adjustment adjustment, double climbRate, uint digits)

Changes the properties of an existing spin row.

connectOutput
ulong connectOutput(T callback, Flag!"After" after)

Connect to Output signal.

connectWrapped
ulong connectWrapped(T callback, Flag!"After" after)

Connect to Wrapped signal.

getAdjustment
gtk.adjustment.Adjustment getAdjustment()

Gets the adjustment that holds the value for the spin row.

getClimbRate
double getClimbRate()

Gets the acceleration rate when you hold down a button or key.

getDigits
uint getDigits()

Gets the number of decimal places to display.

getNumeric
bool getNumeric()

Gets whether non-numeric characters should be ignored.

getSnapToTicks
bool getSnapToTicks()

Gets whether invalid values are snapped to nearest step increment.

getUpdatePolicy
gtk.types.SpinButtonUpdatePolicy getUpdatePolicy()

Gets the policy for updating the spin row.

getValue
double getValue()

Gets the current value.

getWrap
bool getWrap()

Gets whether the spin row should wrap upon reaching its limits.

setAdjustment
void setAdjustment(gtk.adjustment.Adjustment adjustment)

Sets the adjustment that holds the value for the spin row.

setClimbRate
void setClimbRate(double climbRate)

Sets the acceleration rate when you hold down a button or key.

setDigits
void setDigits(uint digits)

Sets the number of decimal places to display.

setNumeric
void setNumeric(bool numeric)

Sets whether non-numeric characters should be ignored.

setRange
void setRange(double min, double max)

Sets the minimum and maximum allowable values for self.

setSnapToTicks
void setSnapToTicks(bool snapToTicks)

Sets whether invalid values are snapped to the nearest step increment.

setUpdatePolicy
void setUpdatePolicy(gtk.types.SpinButtonUpdatePolicy policy)

Sets the policy for updating the spin row.

setValue
void setValue(double value)

Sets the current value.

setWrap
void setWrap(bool wrap)

Sets whether the spin row should wrap upon reaching its limits.

update
void update()

Manually force an update of the spin row.

Static functions

newWithRange
adw.spin_row.SpinRow newWithRange(double min, double max, double step)

Creates a new adw.spin_row.SpinRow with the given properties.

Mixed In Members

From mixin EditableT!()

delegateGetAccessiblePlatformState
bool delegateGetAccessiblePlatformState(gtk.types.AccessiblePlatformState state)

Retrieves the accessible platform state from the editable delegate.

deleteSelection
void deleteSelection()

Deletes the currently selected text of the editable.

deleteText
void deleteText(int startPos, int endPos)

Deletes a sequence of characters.

finishDelegate
void finishDelegate()

Undoes the setup done by gtk.editable.Editable.initDelegate.

getAlignment
float getAlignment()

Gets the alignment of the editable.

getChars
string getChars(int startPos, int endPos)

Retrieves a sequence of characters.

getDelegate
gtk.editable.Editable getDelegate()

Gets the gtk.editable.Editable that editable is delegating its implementation to.

getEditable
bool getEditable()

Retrieves whether editable is editable.

getEnableUndo
bool getEnableUndo()

Gets if undo/redo actions are enabled for editable

getMaxWidthChars
int getMaxWidthChars()

Retrieves the desired maximum width of editable, in characters.

getPosition
int getPosition()

Retrieves the current position of the cursor relative to the start of the content of the editable.

getSelectionBounds
bool getSelectionBounds(int startPos, int endPos)

Retrieves the selection bound of the editable.

getText
string getText()

Retrieves the contents of editable.

getWidthChars
int getWidthChars()

Gets the number of characters of space reserved for the contents of the editable.

initDelegate
void initDelegate()

Sets up a delegate for gtk.editable.Editable.

insertText
void insertText(string text, int position)

Inserts length bytes of text into the contents of the widget, at position position.

selectRegion
void selectRegion(int startPos, int endPos)

Selects a region of text.

setAlignment
void setAlignment(float xalign)

Sets the alignment for the contents of the editable.

setEditable
void setEditable(bool isEditable)

Determines if the user can edit the text in the editable widget.

setEnableUndo
void setEnableUndo(bool enableUndo)

If enabled, changes to editable will be saved for undo/redo actions.

setMaxWidthChars
void setMaxWidthChars(int nChars)

Sets the desired maximum width in characters of editable.

setPosition
void setPosition(int position)

Sets the cursor position in the editable to the given value.

setText
void setText(string text)

Sets the text in the editable to the given value.

setWidthChars
void setWidthChars(int nChars)

Changes the size request of the editable to be about the right size for n_chars characters.

connectChanged
ulong connectChanged(T callback, Flag!"After" after)

Connect to Changed signal.

connectDeleteText
ulong connectDeleteText(T callback, Flag!"After" after)

Connect to DeleteText signal.

Inherited Members

From ActionRow

activate
void activate()

Activates self.

addPrefix
void addPrefix(gtk.widget.Widget widget)

Adds a prefix widget to self.

addSuffix
void addSuffix(gtk.widget.Widget widget)

Adds a suffix widget to self.

getActivatableWidget
gtk.widget.Widget getActivatableWidget()

Gets the widget activated when self is activated.

getIconName
string getIconName()

Gets the icon name for self.

getSubtitle
string getSubtitle()

Gets the subtitle for self.

getSubtitleLines
int getSubtitleLines()

Gets the number of lines at the end of which the subtitle label will be ellipsized.

getSubtitleSelectable
bool getSubtitleSelectable()

Gets whether the user can copy the subtitle from the label

getTitleLines
int getTitleLines()

Gets the number of lines at the end of which the title label will be ellipsized.

remove
void remove(gtk.widget.Widget widget)

Removes a child from self.

setActivatableWidget
void setActivatableWidget(gtk.widget.Widget widget)

Sets the widget to activate when self is activated.

setIconName
void setIconName(string iconName)

Sets the icon name for self.

setSubtitle
void setSubtitle(string subtitle)

Sets the subtitle for self.

setSubtitleLines
void setSubtitleLines(int subtitleLines)

Sets the number of lines at the end of which the subtitle label will be ellipsized.

setSubtitleSelectable
void setSubtitleSelectable(bool subtitleSelectable)

Sets whether the user can copy the subtitle from the label

setTitleLines
void setTitleLines(int titleLines)

Sets the number of lines at the end of which the title label will be ellipsized.

connectActivated
ulong connectActivated(T callback, Flag!"After" after)

Connect to Activated signal.

From Editable

delegateGetProperty
bool delegateGetProperty(gobject.object.ObjectG object, uint propId, gobject.value.Value value, gobject.param_spec.ParamSpec pspec)

Gets a property of the gtk.editable.Editable delegate for object.

delegateSetProperty
bool delegateSetProperty(gobject.object.ObjectG object, uint propId, gobject.value.Value value, gobject.param_spec.ParamSpec pspec)

Sets a property on the gtk.editable.Editable delegate for object.

delegateGetAccessiblePlatformState
bool delegateGetAccessiblePlatformState(gtk.types.AccessiblePlatformState state)

Retrieves the accessible platform state from the editable delegate.

deleteSelection
void deleteSelection()

Deletes the currently selected text of the editable.

deleteText
void deleteText(int startPos, int endPos)

Deletes a sequence of characters.

finishDelegate
void finishDelegate()

Undoes the setup done by gtk.editable.Editable.initDelegate.

getAlignment
float getAlignment()

Gets the alignment of the editable.

getChars
string getChars(int startPos, int endPos)

Retrieves a sequence of characters.

getDelegate
gtk.editable.Editable getDelegate()

Gets the gtk.editable.Editable that editable is delegating its implementation to.

getEditable
bool getEditable()

Retrieves whether editable is editable.

getEnableUndo
bool getEnableUndo()

Gets if undo/redo actions are enabled for editable

getMaxWidthChars
int getMaxWidthChars()

Retrieves the desired maximum width of editable, in characters.

getPosition
int getPosition()

Retrieves the current position of the cursor relative to the start of the content of the editable.

getSelectionBounds
bool getSelectionBounds(int startPos, int endPos)

Retrieves the selection bound of the editable.

getText
string getText()

Retrieves the contents of editable.

getWidthChars
int getWidthChars()

Gets the number of characters of space reserved for the contents of the editable.

initDelegate
void initDelegate()

Sets up a delegate for gtk.editable.Editable.

insertText
void insertText(string text, int position)

Inserts length bytes of text into the contents of the widget, at position position.

selectRegion
void selectRegion(int startPos, int endPos)

Selects a region of text.

setAlignment
void setAlignment(float xalign)

Sets the alignment for the contents of the editable.

setEditable
void setEditable(bool isEditable)

Determines if the user can edit the text in the editable widget.

setEnableUndo
void setEnableUndo(bool enableUndo)

If enabled, changes to editable will be saved for undo/redo actions.

setMaxWidthChars
void setMaxWidthChars(int nChars)

Sets the desired maximum width in characters of editable.

setPosition
void setPosition(int position)

Sets the cursor position in the editable to the given value.

setText
void setText(string text)

Sets the text in the editable to the given value.

setWidthChars
void setWidthChars(int nChars)

Changes the size request of the editable to be about the right size for n_chars characters.

connectChanged
ulong connectChanged(T callback, Flag!"After" after)

Connect to Changed signal.

connectDeleteText
ulong connectDeleteText(T callback, Flag!"After" after)

Connect to DeleteText signal.