SpinButtonProtocol
public protocol SpinButtonProtocol : EntryProtocol, 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 GtkAdjustment section for more details about an adjustment’s
properties. Note that GtkSpinButton will by default make its entry
large enough to accomodate the lower and upper bounds of the adjustment,
which can lead to surprising results. Best practice is to set both
the GtkEntry:width-chars and GtkEntry:max-width-chars poperties
to the desired number of characters to display in the entry.
CSS nodes
(plain Language Example):
spinbutton.horizontal
├── undershoot.left
├── undershoot.right
├── entry
│ ╰── ...
├── button.down
╰── button.up
(plain Language Example):
spinbutton.vertical
├── undershoot.left
├── undershoot.right
├── button.up
├── entry
│ ╰── ...
╰── 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 GtkEntry subnodes (if present) are put below the entry node. The orientation of the spin button is reflected in the .vertical or .horizontal style class on the main node.
Using a GtkSpinButton to get an integer
(C Language Example):
// Provides a function to retrieve an integer value from a GtkSpinButton
// and creates a spin button to model percentage values.
gint
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 (GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
// creates the spinbutton, with no decimal places
button = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show_all (window);
}
Using a GtkSpinButton to get a floating point value
(C Language Example):
// Provides a function to retrieve a floating point value from a
// GtkSpinButton, and creates a high precision spin button.
gfloat
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 (GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
// creates the spinbutton, with three decimal places
button = gtk_spin_button_new (adjustment, 0.001, 3);
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show_all (window);
}
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 methodThe
inputsignal can be used to influence the conversion of the users input into a double value. The signal handler is expected to usegtk_entry_get_text()to retrieve the text of the entry 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: ) The
change-valuesignal is a keybinding signal which gets emitted when the user initiates a value change.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 and/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: ) The
outputsignal can be used to change to formatting of the value that is displayed in the spin buttons entry. (C Language Example):// show leading zeros static gboolean on_output (GtkSpinButton *spin, gpointer data) { GtkAdjustment *adjustment; gchar *text; int value; adjustment = gtk_spin_button_get_adjustment (spin); value = (int)gtk_adjustment_get_value (adjustment); text = g_strdup_printf ("%02d", value); gtk_entry_set_text (GTK_ENTRY (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: ) The
value-changedsignal is emitted when the value represented byspinbuttonchanges. Also see theGtkSpinButton::outputsignal.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: ) The
wrappedsignal is emitted right after the spinbutton wraps from its maximum to 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: Double, 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: Double, digits: Int) where AdjustmentT : AdjustmentProtocol -
getAdjustment()Extension methodGet the adjustment associated with a
GtkSpinButtonDeclaration
Swift
@inlinable func getAdjustment() -> AdjustmentRef! -
getDigits()Extension methodFetches the precision of
spin_button. Seegtk_spin_button_set_digits().Declaration
Swift
@inlinable func getDigits() -> Int -
getIncrements(step:Extension methodpage: ) Gets the current step and page the increments used by
spin_button. Seegtk_spin_button_set_increments().Declaration
Swift
@inlinable func getIncrements(step: UnsafeMutablePointer<gdouble>! = nil, page: UnsafeMutablePointer<gdouble>! = nil) -
getNumeric()Extension methodReturns whether non-numeric text can be typed into the spin button. See
gtk_spin_button_set_numeric().Declaration
Swift
@inlinable func getNumeric() -> Bool -
getRange(min:Extension methodmax: ) Gets the range allowed for
spin_button. Seegtk_spin_button_set_range().Declaration
Swift
@inlinable func getRange(min: UnsafeMutablePointer<gdouble>! = nil, max: UnsafeMutablePointer<gdouble>! = nil) -
getSnapToTicks()Extension methodReturns whether the values are corrected to the nearest step. See
gtk_spin_button_set_snap_to_ticks().Declaration
Swift
@inlinable func getSnapToTicks() -> Bool -
getUpdatePolicy()Extension methodGets the update behavior of a spin button. See
gtk_spin_button_set_update_policy().Declaration
Swift
@inlinable func getUpdatePolicy() -> GtkSpinButtonUpdatePolicy -
getValue()Extension methodGet the value in the
spin_button.Declaration
Swift
@inlinable func getValue() -> Double -
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. See
gtk_spin_button_set_wrap().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(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: Double, page: Double) -
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: Double, max: Double) -
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: Double) -
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: Double) -
update()Extension methodManually force an update of the spin button.
Declaration
Swift
@inlinable func update() -
testSpinButtonClick(button:Extension methodupwards: ) This function will generate a
buttonclick in the upwards or downwards spin button arrow areas, usually leading to an increase or decrease of spin button’s value.test_spin_button_click is deprecated: This testing infrastructure is phased out in favor of reftests.
Declaration
Swift
@available(*, deprecated) @inlinable func testSpinButtonClick(button: Int, upwards: Bool) -> Bool -
adjustmentExtension methodUndocumented
Declaration
Swift
@inlinable var adjustment: AdjustmentRef! { get nonmutating set } -
digitsExtension methodUndocumented
Declaration
Swift
@inlinable var digits: Int { get nonmutating set } -
numericExtension methodUndocumented
Declaration
Swift
@inlinable var numeric: Bool { get nonmutating set } -
snapToTicksExtension methodReturns whether the values are corrected to the nearest step. See
gtk_spin_button_set_snap_to_ticks().Declaration
Swift
@inlinable var snapToTicks: Bool { get nonmutating set } -
updatePolicyExtension methodGets the update behavior of a spin button. See
gtk_spin_button_set_update_policy().Declaration
Swift
@inlinable var updatePolicy: GtkSpinButtonUpdatePolicy { get nonmutating set } -
valueExtension methodUndocumented
Declaration
Swift
@inlinable var value: Double { get nonmutating set } -
valueAsIntExtension methodGet the value
spin_buttonrepresented as an integer.Declaration
Swift
@inlinable var valueAsInt: Int { get } -
wrapExtension methodUndocumented
Declaration
Swift
@inlinable var wrap: Bool { get nonmutating set } -
entryExtension methodUndocumented
Declaration
Swift
@inlinable var entry: GtkEntry { get }
View on GitHub
Install in Dash
SpinButtonProtocol Protocol Reference