SpinButtonProtocol
public protocol SpinButtonProtocol : CellEditableProtocol, EditableProtocol, OrientableProtocol
A GtkSpinButton is an ideal way to allow the user to set the
value of some attribute.

Rather than having to directly type a number into a 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 [classGtk.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 [propertyGtk.Editable:width-chars] to a value != -1.
Using a GtkSpinButton to get an integer
// 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_widget_show (window);
}
Using a GtkSpinButton to get a floating point value
// 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_widget_show (window);
}
CSS nodes
spinbutton.horizontal
├── text
│ ├── undershoot.left
│ ╰── undershoot.right
├── button.down
╰── button.up
spinbutton.vertical
├── button.up
├── text
│ ├── undershoot.left
│ ╰── undershoot.right
╰── button.down
GtkSpinButtons 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.
Accessiblity
GtkSpinButton uses the GTK_ACCESSIBLE_ROLE_SPIN_BUTTON role.
The SpinButtonProtocol protocol exposes the methods and properties of an underlying GtkSpinButton instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see SpinButton.
Alternatively, use SpinButtonRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkSpinButtoninstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
spin_button_ptrDefault implementationTyped pointer to the underlying
GtkSpinButtoninstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkSpinButtoninstance.Declaration
Swift
var spin_button_ptr: UnsafeMutablePointer<GtkSpinButton>! { get } -
Required Initialiser for types conforming to
SpinButtonProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
SpinButtonPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: SpinButtonPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a SpinButton property
Declaration
Swift
@inlinable func get(property: SpinButtonPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a SpinButton property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: SpinButtonPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
SpinButtonSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SpinButtonSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
SpinButtonSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SpinButtonSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
inputSignalExtension methodEmitted to convert the users 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 setnew_valueto the new value.The default conversion uses
g_strtod().Note
This represents the underlyinginputsignalWarning
aonInputwrapper for this signal could not be generated because it contains unimplemented features: { (1) argument with ownership transfer is not allowed, (2)outorinoutargument direction is not allowed }Note
Instead, you can connectinputSignalusing theconnect(signal:)methodsDeclaration
Swift
static var inputSignal: SpinButtonSignalName { get }Parameters
flagsFlags
unownedSelfReference to instance of self
newValuereturn location for the new value
handlertruefor a successful conversion,falseif the input was not handled, andGTK_INPUT_ERRORif the conversion failed. -
onChangeValue(flags:Extension methodhandler: ) Emitted 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.
Note
This represents the underlyingchange-valuesignalDeclaration
Swift
@discardableResult @inlinable func onChangeValue(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ scroll: ScrollType) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
scrolla
GtkScrollTypeto specify the speed and amount of changehandlerThe signal handler to call Run the given callback whenever the
changeValuesignal is emitted -
changeValueSignalExtension methodTyped
change-valuesignal for using theconnect(signal:)methodsDeclaration
Swift
static var changeValueSignal: SpinButtonSignalName { get } -
onOutput(flags:Extension methodhandler: ) Emitted to tweak the formatting of the value for display.
// show leading zeros static gboolean on_output (GtkSpinButton *spin, gpointer data) { GtkAdjustment *adjustment; char *text; int value; adjustment = gtk_spin_button_get_adjustment (spin); value = (int)gtk_adjustment_get_value (adjustment); text = g_strdup_printf ("`02d`", value); gtk_spin_button_set_text (spin, text): g_free (text); return TRUE; }Note
This represents the underlyingoutputsignalDeclaration
Swift
@discardableResult @inlinable func onOutput(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlertrueif the value has been displayed Run the given callback whenever theoutputsignal is emitted -
outputSignalExtension methodTyped
outputsignal for using theconnect(signal:)methodsDeclaration
Swift
static var outputSignal: SpinButtonSignalName { get } -
onValueChanged(flags:Extension methodhandler: ) Emitted when the value is changed.
Also see the [signal
Gtk.SpinButton::output] signal.Note
This represents the underlyingvalue-changedsignalDeclaration
Swift
@discardableResult @inlinable func onValueChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
valueChangedsignal is emitted -
valueChangedSignalExtension methodTyped
value-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var valueChangedSignal: SpinButtonSignalName { get } -
onWrapped(flags:Extension methodhandler: ) Emitted right after the spinbutton wraps from its maximum to its minimum value or vice-versa.
Note
This represents the underlyingwrappedsignalDeclaration
Swift
@discardableResult @inlinable func onWrapped(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
wrappedsignal is emitted -
wrappedSignalExtension methodTyped
wrappedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var wrappedSignal: SpinButtonSignalName { get } -
onNotifyAdjustment(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::adjustmentsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAdjustment(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAdjustmentsignal is emitted -
notifyAdjustmentSignalExtension methodTyped
notify::adjustmentsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAdjustmentSignal: SpinButtonSignalName { get } -
onNotifyClimbRate(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::climb-ratesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyClimbRate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyClimbRatesignal is emitted -
notifyClimbRateSignalExtension methodTyped
notify::climb-ratesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyClimbRateSignal: SpinButtonSignalName { get } -
onNotifyDigits(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::digitssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDigits(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDigitssignal is emitted -
notifyDigitsSignalExtension methodTyped
notify::digitssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDigitsSignal: SpinButtonSignalName { get } -
onNotifyNumeric(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::numericsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNumeric(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNumericsignal is emitted -
notifyNumericSignalExtension methodTyped
notify::numericsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNumericSignal: SpinButtonSignalName { get } -
onNotifySnapToTicks(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::snap-to-tickssignalDeclaration
Swift
@discardableResult @inlinable func onNotifySnapToTicks(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySnapToTickssignal is emitted -
notifySnapToTicksSignalExtension methodTyped
notify::snap-to-tickssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySnapToTicksSignal: SpinButtonSignalName { get } -
onNotifyUpdatePolicy(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::update-policysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyUpdatePolicy(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyUpdatePolicysignal is emitted -
notifyUpdatePolicySignalExtension methodTyped
notify::update-policysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyUpdatePolicySignal: SpinButtonSignalName { get } -
onNotifyValue(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::valuesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyValue(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyValuesignal is emitted -
notifyValueSignalExtension methodTyped
notify::valuesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyValueSignal: SpinButtonSignalName { get } -
onNotifyWrap(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::wrapsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyWrap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyWrapsignal is emitted -
notifyWrapSignalExtension methodTyped
notify::wrapsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyWrapSignal: SpinButtonSignalName { get }
-
configure(adjustment:Extension methodclimbRate: digits: ) Changes the properties of an existing spin button.
The adjustment, climb rate, and number of decimal places are updated accordingly.
Declaration
Swift
@inlinable func configure(adjustment: AdjustmentRef? = nil, climbRate: CDouble, digits: Int) -
configure(adjustment:Extension methodclimbRate: digits: ) Changes the properties of an existing spin button.
The adjustment, climb rate, and number of decimal places are updated accordingly.
Declaration
Swift
@inlinable func configure<AdjustmentT>(adjustment: AdjustmentT?, climbRate: CDouble, digits: Int) where AdjustmentT : AdjustmentProtocol -
getAdjustment()Extension methodGet the adjustment associated with a
GtkSpinButton.Declaration
Swift
@inlinable func getAdjustment() -> AdjustmentRef! -
getClimbRate()Extension methodReturns the acceleration rate for repeated changes.
Declaration
Swift
@inlinable func getClimbRate() -> CDouble -
getDigits()Extension methodFetches the precision of
spin_button.Declaration
Swift
@inlinable func getDigits() -> Int -
getIncrements(step:Extension methodpage: ) Gets the current step and page the increments used by
spin_button.See [method
Gtk.SpinButton.set_increments].Declaration
Swift
@inlinable func getIncrements(step: UnsafeMutablePointer<CDouble>! = nil, page: UnsafeMutablePointer<CDouble>! = nil) -
getNumeric()Extension methodReturns whether non-numeric text can be typed into the spin button.
Declaration
Swift
@inlinable func getNumeric() -> Bool -
getRange(min:Extension methodmax: ) Gets the range allowed for
spin_button.See [method
Gtk.SpinButton.set_range].Declaration
Swift
@inlinable func getRange(min: UnsafeMutablePointer<CDouble>! = nil, max: UnsafeMutablePointer<CDouble>! = nil) -
getSnapToTicks()Extension methodReturns whether the values are corrected to the nearest step.
Declaration
Swift
@inlinable func getSnapToTicks() -> Bool -
getUpdatePolicy()Extension methodGets the update behavior of a spin button.
See [method
Gtk.SpinButton.set_update_policy].Declaration
Swift
@inlinable func getUpdatePolicy() -> GtkSpinButtonUpdatePolicy -
getValue()Extension methodGet the value in the
spin_button.Declaration
Swift
@inlinable func getValue() -> CDouble -
getValueAsInt()Extension methodGet the value
spin_buttonrepresented as an integer.Declaration
Swift
@inlinable func getValueAsInt() -> Int -
getWrap()Extension methodReturns whether the spin button’s value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
Declaration
Swift
@inlinable func getWrap() -> Bool -
set(adjustment:Extension method) Replaces the
GtkAdjustmentassociated withspin_button.Declaration
Swift
@inlinable func set<AdjustmentT>(adjustment: AdjustmentT) where AdjustmentT : AdjustmentProtocol -
set(climbRate:Extension method) Sets the acceleration rate for repeated changes when you hold down a button or key.
Declaration
Swift
@inlinable func set(climbRate: CDouble) -
set(digits:Extension method) Set the precision to be displayed by
spin_button.Up to 20 digit precision is allowed.
Declaration
Swift
@inlinable func set(digits: Int) -
setIncrements(step:Extension methodpage: ) Sets the step and page increments for spin_button.
This affects how quickly the value changes when the spin button’s arrows are activated.
Declaration
Swift
@inlinable func setIncrements(step: CDouble, page: CDouble) -
set(numeric:Extension method) Sets the flag that determines if non-numeric text can be typed into the spin button.
Declaration
Swift
@inlinable func set(numeric: Bool) -
setRange(min:Extension methodmax: ) 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.
Declaration
Swift
@inlinable func setRange(min: CDouble, max: CDouble) -
set(snapToTicks:Extension method) 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.
Declaration
Swift
@inlinable func set(snapToTicks: Bool) -
setUpdate(policy:Extension method) 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.
Declaration
Swift
@inlinable func setUpdate(policy: GtkSpinButtonUpdatePolicy) -
set(value:Extension method) Sets the value of
spin_button.Declaration
Swift
@inlinable func set(value: CDouble) -
set(wrap:Extension method) 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.
Declaration
Swift
@inlinable func set(wrap: Bool) -
spin(direction:Extension methodincrement: ) Increment or decrement a spin button’s value in a specified direction by a specified amount.
Declaration
Swift
@inlinable func spin(direction: GtkSpinType, increment: CDouble) -
update()Extension methodManually force an update of the spin button.
Declaration
Swift
@inlinable func update() -
adjustmentExtension methodThe adjustment that holds the value of the spin button.
Declaration
Swift
@inlinable var adjustment: AdjustmentRef! { get nonmutating set } -
climbRateExtension methodReturns the acceleration rate for repeated changes.
Declaration
Swift
@inlinable var climbRate: CDouble { get nonmutating set } -
digitsExtension methodThe number of decimal places to display.
Declaration
Swift
@inlinable var digits: Int { get nonmutating set } -
numericExtension methodWhether non-numeric characters should be ignored.
Declaration
Swift
@inlinable var numeric: Bool { get nonmutating set } -
snapToTicksExtension methodReturns whether the values are corrected to the nearest step.
Declaration
Swift
@inlinable var snapToTicks: Bool { get nonmutating set } -
updatePolicyExtension methodGets the update behavior of a spin button.
See [method
Gtk.SpinButton.set_update_policy].Declaration
Swift
@inlinable var updatePolicy: GtkSpinButtonUpdatePolicy { get nonmutating set } -
valueExtension methodThe current value.
Declaration
Swift
@inlinable var value: CDouble { get nonmutating set } -
valueAsIntExtension methodGet the value
spin_buttonrepresented as an integer.Declaration
Swift
@inlinable var valueAsInt: Int { get } -
wrapExtension methodWhether a spin button should wrap upon reaching its limits.
Declaration
Swift
@inlinable var wrap: Bool { get nonmutating set }
View on GitHub
Install in Dash
SpinButtonProtocol Protocol Reference