Skip to main content

Type Alias: GtkSpinButtonProps

GtkSpinButtonProps = WidgetProps & object

Defined in: generated/jsx.ts:6876

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:6882
climbRate?numberThe acceleration rate when you hold down a button or key.generated/jsx.ts:6884
digits?numberThe number of decimal places to display.generated/jsx.ts:6886
editable?booleanWhether the entry contents can be edited.generated/jsx.ts:6906
editingCanceled?booleanIndicates whether editing on the cell has been canceled.generated/jsx.ts:6904
enableUndo?booleanIf undo/redo should be enabled for the editable.generated/jsx.ts:6908
lower?numberThe minimum valuegenerated/jsx.ts:7044
maxWidthChars?numberThe desired maximum width of the entry, in characters.generated/jsx.ts:6910
numeric?booleanWhether non-numeric characters should be ignored.generated/jsx.ts:6888
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:6932
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:7021
onChangeValue?(scroll, self) => 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:6944
onDeleteText?(startPos, endPos, self) => 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:7033
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:6995
onInput?(newValue, self) => 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:6954
onInsertText?(text, length, position, self) => 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:7042
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:6976
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:7010
onValueChanged?(value, self) => void | nullCallback when the value changesgenerated/jsx.ts:7054
onWrapped?(self) => void | nullEmitted right after the spinbutton wraps from its maximum to its minimum value or vice-versa.generated/jsx.ts:6981
orientation?Gtk.OrientationThe orientation of the orientable.generated/jsx.ts:6922
pageIncrement?numberThe increment for page up/downgenerated/jsx.ts:7050
pageSize?numberThe page size (usually 0 for scales)generated/jsx.ts:7052
ref?Ref<Gtk.SpinButton>-generated/jsx.ts:7055
snapToTicks?booleanWhether erroneous values are automatically changed to the spin buttons nearest step increment.generated/jsx.ts:6893
stepIncrement?numberThe increment for arrow keysgenerated/jsx.ts:7048
text?stringThe contents of the entry.generated/jsx.ts:6912
updatePolicy?Gtk.SpinButtonUpdatePolicyWhether the spin button should update always, or only when the value is acceptable.generated/jsx.ts:6898
upper?numberThe maximum valuegenerated/jsx.ts:7046
value?numberThe current value.generated/jsx.ts:6900
widthChars?numberNumber of characters to leave space for in the entry.generated/jsx.ts:6914
wrap?booleanWhether a spin button should wrap upon reaching its limits.generated/jsx.ts:6902
xalign?numberThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.generated/jsx.ts:6920