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
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.
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
GtkSpinButton
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
spin_button_ptr
Default implementationTyped pointer to the underlying
GtkSpinButton
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkSpinButton
instance.Declaration
Swift
var spin_button_ptr: UnsafeMutablePointer<GtkSpinButton>! { get }
-
Required Initialiser for types conforming to
SpinButtonProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
SpinButtonPropertyName
source 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 : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a SpinButton property
Declaration
Swift
@inlinable func get(property: SpinButtonPropertyName) -> GLibObject.Value
Parameters
property
the 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
property
the 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
SpinButtonSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SpinButtonSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The 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
SpinButtonSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: SpinButtonSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
inputSignal
Extension 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_value
to the new value.The default conversion uses
g_strtod()
.Note
This represents the underlyinginput
signalWarning
aonInput
wrapper for this signal could not be generated because it contains unimplemented features: { (1) argument with ownership transfer is not allowed, (2)out
orinout
argument direction is not allowed }Note
Instead, you can connectinputSignal
using theconnect(signal:)
methodsDeclaration
Swift
static var inputSignal: SpinButtonSignalName { get }
Parameters
flags
Flags
unownedSelf
Reference to instance of self
newValue
return location for the new value
handler
true
for a successful conversion,false
if the input was not handled, andGTK_INPUT_ERROR
if 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-value
signalDeclaration
Swift
@discardableResult @inlinable func onChangeValue(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ scroll: ScrollType) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
scroll
a
GtkScrollType
to specify the speed and amount of changehandler
The signal handler to call Run the given callback whenever the
changeValue
signal is emitted -
changeValueSignal
Extension methodTyped
change-value
signal 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 underlyingoutput
signalDeclaration
Swift
@discardableResult @inlinable func onOutput(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
true
if the value has been displayed Run the given callback whenever theoutput
signal is emitted -
outputSignal
Extension methodTyped
output
signal 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-changed
signalDeclaration
Swift
@discardableResult @inlinable func onValueChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
valueChanged
signal is emitted -
valueChangedSignal
Extension methodTyped
value-changed
signal 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 underlyingwrapped
signalDeclaration
Swift
@discardableResult @inlinable func onWrapped(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
wrapped
signal is emitted -
wrappedSignal
Extension methodTyped
wrapped
signal 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 innotify
being 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::adjustment
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyAdjustment(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyAdjustment
signal is emitted -
notifyAdjustmentSignal
Extension methodTyped
notify::adjustment
signal 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 innotify
being 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-rate
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyClimbRate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyClimbRate
signal is emitted -
notifyClimbRateSignal
Extension methodTyped
notify::climb-rate
signal 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 innotify
being 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::digits
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyDigits(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyDigits
signal is emitted -
notifyDigitsSignal
Extension methodTyped
notify::digits
signal 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 innotify
being 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::numeric
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyNumeric(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyNumeric
signal is emitted -
notifyNumericSignal
Extension methodTyped
notify::numeric
signal 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 innotify
being 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-ticks
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySnapToTicks(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySnapToTicks
signal is emitted -
notifySnapToTicksSignal
Extension methodTyped
notify::snap-to-ticks
signal 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 innotify
being 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-policy
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyUpdatePolicy(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyUpdatePolicy
signal is emitted -
notifyUpdatePolicySignal
Extension methodTyped
notify::update-policy
signal 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 innotify
being 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::value
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyValue(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyValue
signal is emitted -
notifyValueSignal
Extension methodTyped
notify::value
signal 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 innotify
being 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::wrap
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyWrap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: SpinButtonRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyWrap
signal is emitted -
notifyWrapSignal
Extension methodTyped
notify::wrap
signal 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_button
represented 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
GtkAdjustment
associated 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()
-
adjustment
Extension methodThe adjustment that holds the value of the spin button.
Declaration
Swift
@inlinable var adjustment: AdjustmentRef! { get nonmutating set }
-
climbRate
Extension methodReturns the acceleration rate for repeated changes.
Declaration
Swift
@inlinable var climbRate: CDouble { get nonmutating set }
-
digits
Extension methodThe number of decimal places to display.
Declaration
Swift
@inlinable var digits: Int { get nonmutating set }
-
numeric
Extension methodWhether non-numeric characters should be ignored.
Declaration
Swift
@inlinable var numeric: Bool { get nonmutating set }
-
snapToTicks
Extension methodReturns whether the values are corrected to the nearest step.
Declaration
Swift
@inlinable var snapToTicks: Bool { get nonmutating set }
-
updatePolicy
Extension methodGets the update behavior of a spin button.
See [method
Gtk.SpinButton.set_update_policy
].Declaration
Swift
@inlinable var updatePolicy: GtkSpinButtonUpdatePolicy { get nonmutating set }
-
value
Extension methodThe current value.
Declaration
Swift
@inlinable var value: CDouble { get nonmutating set }
-
valueAsInt
Extension methodGet the value
spin_button
represented as an integer.Declaration
Swift
@inlinable var valueAsInt: Int { get }
-
wrap
Extension methodWhether a spin button should wrap upon reaching its limits.
Declaration
Swift
@inlinable var wrap: Bool { get nonmutating set }