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
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 methodThe
input
signal 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_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: ) The
change-value
signal 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-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: ) The
output
signal 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 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: ) The
value-changed
signal is emitted when the value represented byspinbutton
changes. Also see theGtkSpinButton::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: ) The
wrapped
signal is emitted right after the spinbutton wraps from its maximum to 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: 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
GtkSpinButton
Declaration
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_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. See
gtk_spin_button_set_wrap()
.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(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
button
click 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
-
adjustment
Extension methodUndocumented
Declaration
Swift
@inlinable var adjustment: AdjustmentRef! { get nonmutating set }
-
digits
Extension methodUndocumented
Declaration
Swift
@inlinable var digits: Int { get nonmutating set }
-
numeric
Extension methodUndocumented
Declaration
Swift
@inlinable var numeric: Bool { get nonmutating set }
-
snapToTicks
Extension 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 }
-
updatePolicy
Extension methodGets the update behavior of a spin button. See
gtk_spin_button_set_update_policy()
.Declaration
Swift
@inlinable var updatePolicy: GtkSpinButtonUpdatePolicy { get nonmutating set }
-
value
Extension methodUndocumented
Declaration
Swift
@inlinable var value: Double { get nonmutating set }
-
valueAsInt
Extension methodGet the value
spin_button
represented as an integer.Declaration
Swift
@inlinable var valueAsInt: Int { get }
-
wrap
Extension methodUndocumented
Declaration
Swift
@inlinable var wrap: Bool { get nonmutating set }
-
entry
Extension methodUndocumented
Declaration
Swift
@inlinable var entry: GtkEntry { get }