[1054:7] extends: object
Generated low-level callback wrapper for GIR callback wrapped.
SpinButtonWrappedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[773:7] extends: object
Generated low-level callback wrapper for GIR callback activate.
SpinButtonActivateCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[984:7] extends: object
Generated low-level callback wrapper for GIR callback value-changed.
SpinButtonValuechangedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[914:7] extends: object
Generated low-level callback wrapper for GIR callback output.
SpinButtonOutputCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[1124:14] static extends: object
Generated metadata helpers for SpinButton class surfaces.
properties ()
Returns property metadata for
SpinButton.
A list.signals ()
Returns signal metadata for
SpinButton.
A list.[747:14] static extends: object
Alternate constructors for SpinButton. Usage:
SpinButtonCtors.<name>(...). The primary constructor lives
directly on SpinButton.
newWithRange (double min, double max, double step)
Creates a new
GtkSpinButtonwith the given properties. This is a convenience constructor that allows creation of a numericGtkSpinButtonwithout 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 button is equivalent to the precision of @step. Note that 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@Gtk.SpinButton.set_digits] to correct it.
min is Minimum allowable value.max is Maximum allowable value.step is Increment added or subtracted by spinning the widget.A new SpinButton.[843:7] extends: object
Generated low-level callback wrapper for GIR callback change-value.
SpinButtonChangevalueCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, scroll, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[55:7] extends: object
Allows to enter or change numeric values.
GtkEntry, GtkSpinButton allows
the user to click on one of two arrows to increment or decrement the
displayed value. A value can still be typed in, with the bonus that it can be
checked to ensure it is in a given range. The main properties of a
GtkSpinButton are through an adjustment. See the [class@Gtk.Adjustment]
documentation for more details about an adjustment's properties. Note that
GtkSpinButton will by default make its entry large enough to accommodate
the lower and upper bounds of the adjustment. If this is not desired, the
automatic sizing can be turned off by explicitly setting
[property@Gtk.Editable:width-chars] to a value != -1. ## Using a
GtkSpinButton to get an integer c // Provides a function to retrieve an integer value from a GtkSpinButton // and creates a spin button to model percentage values. int grab_int_value (GtkSpinButton *button, gpointer user_data) { return gtk_spin_button_get_value_as_int (button); } void create_integer_spin_button (void) { GtkWidget *window, *button; GtkAdjustment *adjustment; adjustment = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 0.0); window = gtk_window_new (); // creates the spinbutton, with no decimal places button = gtk_spin_button_new (adjustment, 1.0, 0); gtk_window_set_child (GTK_WINDOW (window), button); gtk_window_present (GTK_WINDOW (window)); } ## Using a GtkSpinButton to get a floating point
value ```c // Provides a function to retrieve a floating point value from a
// GtkSpinButton, and creates a high precision spin button. float
grab_float_value (GtkSpinButton *button, gpointer user_data) { return
gtk_spin_button_get_value (button); } void create_floating_spin_button (void)
{ GtkWidget *window, *button; GtkAdjustment *adjustment; adjustment =
gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.0); window =
gtk_window_new (); // creates the spinbutton, with three decimal places
button = gtk_spin_button_new (adjustment, 0.001, 3); gtk_window_set_child
(GTK_WINDOW (window), button); gtk_window_present (GTK_WINDOW (window)); }
- [signal@Gtk.SpinButton::change-value] # CSS nodes ``` spinbutton.horizontal
├── text │ ├── undershoot.left │ ╰── undershoot.right ├── button.down ╰──
button.up ``` ``` spinbutton.vertical ├── button.up ├── text │ ├──
undershoot.left │ ╰── undershoot.right ╰── button.down ``` `GtkSpinButton`s
main CSS node has the name spinbutton. It creates subnodes for the entry and
the two buttons, with these names. The button nodes have the style classes
.up and .down. The `GtkText` subnodes (if present) are put below the text
node. The orientation of the spin button is reflected in the .vertical or
.horizontal style class on the main node. # Accessibility `GtkSpinButton`
uses the [enum@Gtk.AccessibleRole.spin_button] role.
#### Members
- **handleObj**
- **lib**
- **retainedCallbacks**
- **signalHandlerNames**
- **signalSetterHandlers**
#### Methods
- **SpinButton** (`adjustment = null, climb_rate = null, digits = null`)
> Creates a new `GtkSpinButton`.
- **@p** `adjustment` is the `GtkAdjustment` that this spin button should use.
- **@p** `climb_rate` is specifies by how much the rate of change in the value will accelerate if you continue to hold down an up/down button or arrow key.
- **@p** `digits` is the number of decimal places to display.
- **toNativeHandle** (`Source`)
> Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from `fn.call(...)`, another generated wrapper exposing `handle()`, or null. Returns null when the argument carries no pointer.
- **@p** `Source` is the raw handle, raw buffer, wrapper, or null.
- **@r** `A` raw pointer carrier or null when no pointer is present.
- **getLib** ()
> Returns the opened native library for this generated wrapper.
- **@r** `The` opened native library.
- **handle** ()
> Returns the wrapped NativeHandle.
- **@r** `The` wrapped NativeHandle.
- **isNull** ()
> Returns true when the wrapped handle is null.
- **@r** `A` bool.
- **describe** ()
> Returns a small string for debugging generated wrappers.
- **@r** `A` string.
- **asWidget** ()
> Wraps this handle as `Widget`.
- **@r** `A` `Widget` object.
- **asAccessible** ()
> Wraps this handle as `Accessible`.
- **@r** `A` `Accessible` object.
- **asAccessibleRange** ()
> Wraps this handle as `AccessibleRange`.
- **@r** `A` `AccessibleRange` object.
- **asBuildable** ()
> Wraps this handle as `Buildable`.
- **@r** `A` `Buildable` object.
- **asCellEditable** ()
> Wraps this handle as `CellEditable`.
- **@r** `A` `CellEditable` object.
- **asConstraintTarget** ()
> Wraps this handle as `ConstraintTarget`.
- **@r** `A` `ConstraintTarget` object.
- **asEditable** ()
> Wraps this handle as `Editable`.
- **@r** `A` `Editable` object.
- **asOrientable** ()
> Wraps this handle as `Orientable`.
- **@r** `A` `Orientable` object.
- **connectSignal** (`string Name, CallbackObj`)
> Connects one generated callback wrapper to a named signal.
- **@p** `Name` is the signal name.
- **@p** `CallbackObj` is the generated callback wrapper to connect.
- **@r** `The` connected handler id.
- **disconnectSignalHandler** (`int HandlerId`)
> Disconnects one retained signal handler id.
- **@p** `HandlerId` is the signal handler id to disconnect.
- **@r** `None.`
- **setOnActivate** (`callback Fn, UserData = null`)
> Emitted when the spin button is activated. The keybindings for this signal are all forms of the <kbd>Enter</kbd> key. If the <kbd>Enter</kbd> key results in the value being committed to the spin button, then activation does not occur until <kbd>Enter</kbd> is pressed again.
- **@p** `Fn` is the Aussom callback.
- **@p** `Fn` is called with (SpinButton Self).
- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
- **@r** `The` connected handler id.
- **setOnChangevalue** (`callback Fn, UserData = null`)
> Emitted when the user initiates a value change. This is a [keybinding signal](class.SignalAction.html). 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.
- **@p** `Fn` is the Aussom callback.
- **@p** `Fn` is called with (SpinButton Self, string Scroll).
- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
- **@r** `The` connected handler id.
- **setOnOutput** (`callback Fn, UserData = null`)
> Emitted to tweak the formatting of the value for display. ```c // 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; } ```
- **@p** `Fn` is the Aussom callback.
- **@p** `Fn` is called with (SpinButton Self).
- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
- **@r** `The` connected handler id.
- **setOnValuechanged** (`callback Fn, UserData = null`)
> Emitted when the value is changed. Also see the [signal@Gtk.SpinButton::output] signal.
- **@p** `Fn` is the Aussom callback.
- **@p** `Fn` is called with (SpinButton Self).
- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
- **@r** `The` connected handler id.
- **setOnWrapped** (`callback Fn, UserData = null`)
> Emitted right after the spinbutton wraps from its maximum to its minimum value or vice-versa.
- **@p** `Fn` is the Aussom callback.
- **@p** `Fn` is called with (SpinButton Self).
- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
- **@r** `The` connected handler id.
- **getProperty** (`string Name`)
> Reads one generated property by name.
- **setProperty** (`string Name, Value`)
> Writes one generated property by name.
- **setActivatesdefault** (`bool Value`)
> Whether to activate the default widget when the spin button is activated. See [signal@Gtk.SpinButton::activate] for what counts as activation.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setAdjustment** (`object Value`)
> The adjustment that holds the value of the spin button.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setClimbrate** (`double Value`)
> The acceleration rate when you hold down a button or key.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setDigits** (`int Value`)
> The number of decimal places to display.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setNumeric** (`bool Value`)
> Whether non-numeric characters should be ignored.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setSnaptoticks** (`bool Value`)
> Whether erroneous values are automatically changed to the spin buttons nearest step increment.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setUpdatepolicy** (`string Value`)
> Whether the spin button should update always, or only when the value is acceptable.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setValue** (`double Value`)
> The current value.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **setWrap** (`bool Value`)
> Whether a spin button should wrap upon reaching its limits.
- **@p** `Value` is the new property value.
- **@r** `None.`
- **configure** (`object adjustment, double climb_rate, int digits`)
> Changes the properties of an existing spin button. The adjustment, climb rate, and number of decimal places are updated accordingly.
- **@p** `adjustment` is a `GtkAdjustment` to replace the spin button’s existing adjustment, or %NULL to leave its current adjustment unchanged.
- **@p** `climb_rate` is the new climb rate.
- **@p** `digits` is the number of decimal places to display in the spin button.
- **@r** `None.`
- **get\_activates\_default** ()
> Retrieves the value set by [method@Gtk.SpinButton.set_activates_default].
- **get\_adjustment** ()
> Get the adjustment associated with a `GtkSpinButton`.
- **get\_climb\_rate** ()
> Returns the acceleration rate for repeated changes.
- **get\_digits** ()
> Fetches the precision of @spin_button.
- **get\_numeric** ()
> Returns whether non-numeric text can be typed into the spin button.
- **get\_snap\_to\_ticks** ()
> Returns whether the values are corrected to the nearest step.
- **get\_update\_policy** ()
> Gets the update behavior of a spin button. See [method@Gtk.SpinButton.set_update_policy].
- **get\_value** ()
> Get the value in the @spin_button.
- **get\_value\_as\_int** ()
> Get the value @spin_button represented as an integer.
- **get\_wrap** ()
> Returns whether the spin button’s value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
- **set\_activates\_default** (`bool activates_default`)
> Sets whether activating the spin button will activate the default widget for the window containing the spin button. See [signal@Gtk.SpinButton::activate] for what counts as activation.
- **@p** `activates_default` is %TRUE to activate window’s default widget on activation.
- **@r** `None.`
- **set\_adjustment** (`object adjustment`)
> Replaces the `GtkAdjustment` associated with @spin_button.
- **@p** `adjustment` is a `GtkAdjustment` to replace the existing adjustment.
- **@r** `None.`
- **set\_climb\_rate** (`double climb_rate`)
> Sets the acceleration rate for repeated changes when you hold down a button or key.
- **@p** `climb_rate` is the rate of acceleration, must be >= 0.
- **@r** `None.`
- **set\_digits** (`int digits`)
> Set the precision to be displayed by @spin_button. Up to 20 digit precision is allowed.
- **@p** `digits` is the number of digits after the decimal point to be displayed for the spin button’s value.
- **@r** `None.`
- **set\_increments** (`double step, double page`)
> Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button’s arrows are activated.
- **@p** `step` is increment applied for a button 1 press..
- **@p** `page` is increment applied for a button 2 press..
- **@r** `None.`
- **set\_numeric** (`bool numeric`)
> Sets the flag that determines if non-numeric text can be typed into the spin button.
- **@p** `numeric` is flag indicating if only numeric entry is allowed.
- **@r** `None.`
- **set\_range** (`double min, double max`)
> Sets the minimum and maximum allowable values for @spin_button. If the current value is outside this range, it will be adjusted to fit within the range, otherwise it will remain unchanged.
- **@p** `min` is minimum allowable value.
- **@p** `max` is maximum allowable value.
- **@r** `None.`
- **set\_snap\_to\_ticks** (`bool snap_to_ticks`)
> Sets the policy as to whether values are corrected to the nearest step increment when a spin button is activated after providing an invalid value.
- **@p** `snap_to_ticks` is a flag indicating if invalid values should be corrected.
- **@r** `None.`
- **set\_update\_policy** (`string policy`)
> Sets the update behavior of a spin button. This determines whether the spin button is always updated or only when a valid value is set.
- **@p** `policy` is a `GtkSpinButtonUpdatePolicy` value.
- **@r** `None.`
- **set\_value** (`double value`)
> Sets the value of @spin_button.
- **@p** `value` is the new value.
- **@r** `None.`
- **set\_wrap** (`bool wrap`)
> Sets the flag that determines if a spin button value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
- **@p** `wrap` is a flag indicating if wrapping behavior is performed.
- **@r** `None.`
- **spin** (`string direction, double increment`)
> Increment or decrement a spin button’s value in a specified direction by a specified amount.
- **@p** `direction` is a `GtkSpinType` indicating the direction to spin.
- **@p** `increment` is step increment to apply in the specified direction.
- **@r** `None.`
- **update** ()
> Manually force an update of the spin button.
- **@r** `None.`