Skip to main content

Type Alias: GtkSpinButtonProps

GtkSpinButtonProps = WidgetProps & object

Defined in: generated/jsx.ts:8528

Props for the GtkSpinButton widget.

Type Declaration

NameTypeDescriptionDefined in
activatesDefault?booleanWhether to activate the default widget when the spin button is activated. See SpinButton.:activate for what counts as activation.generated/jsx.ts:8534
children?ReactNode-generated/jsx.ts:8701
climbRate?numberThe acceleration rate when you hold down a button or key.generated/jsx.ts:8536
digits?numberThe number of decimal places to display.generated/jsx.ts:8538
editable?booleanWhether the entry contents can be edited.generated/jsx.ts:8558
editingCanceled?booleanIndicates whether editing on the cell has been canceled.generated/jsx.ts:8556
enableUndo?booleanIf undo/redo should be enabled for the editable.generated/jsx.ts:8560
maxWidthChars?numberThe desired maximum width of the entry, in characters.generated/jsx.ts:8562
numeric?booleanWhether non-numeric characters should be ignored.generated/jsx.ts:8540
onActivate()?(self) => void | nullEmitted when the spin button is activated. The keybindings for this signal are all forms of the Enter key. If the Enter key results in the value being committed to the spin button, then activation does not occur until Enter is pressed again.generated/jsx.ts:8584
onChanged()?(self) => void | nullEmitted at the end of a single user-visible operation on the contents. E.g., a paste operation that replaces the contents of the selection will cause only one signal emission (even though it is implemented by first deleting the selection, then inserting the new content, and may cause multiple ::notify::text signals to be emitted).generated/jsx.ts:8679
onChangeValue()?(self, scroll) => void | nullEmitted when the user initiates a value change. This is a keybinding signal. Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically. The default bindings for this signal are Up/Down and PageUp/PageDown.generated/jsx.ts:8596
onDeleteText()?(self, startPos, endPos) => void | nullEmitted when text is deleted from the widget by the user. The default handler for this signal will normally be responsible for deleting the text, so by connecting to this signal and then stopping the signal with g_signal_stop_emission(), it is possible to modify the range of deleted text, or prevent it from being deleted entirely. The start_pos and end_pos parameters are interpreted as for Editable.delete_text.generated/jsx.ts:8691
onEditingDone()?(self) => void | nullThis signal is a sign for the cell renderer to update its value from the cell_editable. Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing, e.g. GtkEntry emits this signal when the user presses Enter. Typical things to do in a handler for ::editing-done are to capture the edited value, disconnect the cell_editable from signals on the GtkCellRenderer, etc. gtk_cell_editable_editing_done() is a convenience method for emitting GtkCellEditable::editing-done.generated/jsx.ts:8653
onInput()?(self, newValue) => number | nullEmitted to convert the users input into a double value. The signal handler is expected to use Editable.get_text to retrieve the text of the spinbutton and set new_value to the new value. The default conversion uses g_strtod().generated/jsx.ts:8606
onInsertText()?(self, text, length, position) => void | nullEmitted when text is inserted into the widget by the user. The default handler for this signal will normally be responsible for inserting the text, so by connecting to this signal and then stopping the signal with g_signal_stop_emission(), it is possible to modify the inserted text, or prevent it from being inserted entirely.generated/jsx.ts:8700
onNotify?(self, propName) => void | nullCalled when any property on this widget changes. Param The widget that emitted the notification Param The name of the property that changed (in kebab-case)generated/jsx.ts:8707
onOutput()?(self) => boolean | nullEmitted to tweak the formatting of the value for display. // show leading zeros static gboolean on_output (GtkSpinButton *spin, gpointer data) { char *text; int value; value = gtk_spin_button_get_value_as_int (spin); text = g_strdup_printf ("%02d", value); gtk_editable_set_text (GTK_EDITABLE (spin), text): g_free (text); return TRUE; }generated/jsx.ts:8628
onRemoveWidget()?(self) => void | nullThis signal is meant to indicate that the cell is finished editing, and the cell_editable widget is being removed and may subsequently be destroyed. Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing. It must be emitted after the GtkCellEditable::editing-done signal, to give the cell renderer a chance to update the cell's value before the widget is removed. gtk_cell_editable_remove_widget() is a convenience method for emitting GtkCellEditable::remove-widget.generated/jsx.ts:8668
onValueChanged()?(self) => void | nullEmitted when the value is changed. Also see the SpinButton.:output signal.generated/jsx.ts:8634
onWrapped()?(self) => void | nullEmitted right after the spinbutton wraps from its maximum to its minimum value or vice-versa.generated/jsx.ts:8639
orientation?Gtk.OrientationThe orientation of the orientable.generated/jsx.ts:8574
ref?Ref<Gtk.SpinButton>-generated/jsx.ts:8730
snapToTicks?booleanWhether erroneous values are automatically changed to the spin buttons nearest step increment.generated/jsx.ts:8545
text?stringThe contents of the entry.generated/jsx.ts:8564
updatePolicy?Gtk.SpinButtonUpdatePolicyWhether the spin button should update always, or only when the value is acceptable.generated/jsx.ts:8550
value?numberThe current value.generated/jsx.ts:8552
widthChars?numberNumber of characters to leave space for in the entry.generated/jsx.ts:8566
wrap?booleanWhether a spin button should wrap upon reaching its limits.generated/jsx.ts:8554
xalign?numberThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.generated/jsx.ts:8572