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.

  • ptr

    Untyped pointer to the underlying GtkSpinButton instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • spin_button_ptr Default implementation

    Typed 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)

SpinButton Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

SpinButton signals

  • Connect a Swift signal handler to the given, typed SpinButtonSignalName signal

    Declaration

    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 by userData

    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 a C signal handler to the given, typed SpinButtonSignalName signal

    Declaration

    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 by userData

    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 method

    The input signal can be used to influence the conversion of the users input into a double value. The signal handler is expected to use gtk_entry_get_text() to retrieve the text of the entry and set new_value to the new value.

    The default conversion uses g_strtod().

    Note

    This represents the underlying input signal

    Warning

    a onInput wrapper for this signal could not be generated because it contains unimplemented features: { (1) argument with ownership transfer is not allowed, (2) out or inout argument direction is not allowed }

    Note

    Instead, you can connect inputSignal using the connect(signal:) methods

    Declaration

    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, and GTK_INPUT_ERROR if the conversion failed.

  • 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 underlying change-value signal

    Declaration

    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 change

    handler

    The signal handler to call Run the given callback whenever the changeValue signal is emitted

  • changeValueSignal Extension method

    Typed change-value signal for using the connect(signal:) methods

    Declaration

    Swift

    static var changeValueSignal: SpinButtonSignalName { get }
  • onOutput(flags:handler:) Extension method

    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 underlying output signal

    Declaration

    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 the output signal is emitted

  • outputSignal Extension method

    Typed output signal for using the connect(signal:) methods

    Declaration

    Swift

    static var outputSignal: SpinButtonSignalName { get }
  • The value-changed signal is emitted when the value represented by spinbutton changes. Also see the GtkSpinButton::output signal.

    Note

    This represents the underlying value-changed signal

    Declaration

    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 method

    Typed value-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var valueChangedSignal: SpinButtonSignalName { get }
  • onWrapped(flags:handler:) Extension method

    The wrapped signal is emitted right after the spinbutton wraps from its maximum to minimum value or vice-versa.

    Note

    This represents the underlying wrapped signal

    Declaration

    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 method

    Typed wrapped signal for using the connect(signal:) methods

    Declaration

    Swift

    static var wrappedSignal: SpinButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::adjustment signal

    Declaration

    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 method

    Typed notify::adjustment signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyAdjustmentSignal: SpinButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::climb-rate signal

    Declaration

    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 method

    Typed notify::climb-rate signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyClimbRateSignal: SpinButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::digits signal

    Declaration

    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 method

    Typed notify::digits signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyDigitsSignal: SpinButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::numeric signal

    Declaration

    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 method

    Typed notify::numeric signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNumericSignal: SpinButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::snap-to-ticks signal

    Declaration

    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 method

    Typed notify::snap-to-ticks signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySnapToTicksSignal: SpinButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::update-policy signal

    Declaration

    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 method

    Typed notify::update-policy signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyUpdatePolicySignal: SpinButtonSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::value signal

    Declaration

    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 method

    Typed notify::value signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyValueSignal: SpinButtonSignalName { get }
  • onNotifyWrap(flags:handler:) Extension method

    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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::wrap signal

    Declaration

    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 method

    Typed notify::wrap signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyWrapSignal: SpinButtonSignalName { get }

SpinButton Class: SpinButtonProtocol extension (methods and fields)

  • 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)
  • 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 method

    Get the adjustment associated with a GtkSpinButton

    Declaration

    Swift

    @inlinable
    func getAdjustment() -> AdjustmentRef!
  • getDigits() Extension method

    Fetches the precision of spin_button. See gtk_spin_button_set_digits().

    Declaration

    Swift

    @inlinable
    func getDigits() -> Int
  • getIncrements(step:page:) Extension method

    Gets the current step and page the increments used by spin_button. See gtk_spin_button_set_increments().

    Declaration

    Swift

    @inlinable
    func getIncrements(step: UnsafeMutablePointer<gdouble>! = nil, page: UnsafeMutablePointer<gdouble>! = nil)
  • getNumeric() Extension method

    Returns 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:max:) Extension method

    Gets the range allowed for spin_button. See gtk_spin_button_set_range().

    Declaration

    Swift

    @inlinable
    func getRange(min: UnsafeMutablePointer<gdouble>! = nil, max: UnsafeMutablePointer<gdouble>! = nil)
  • getSnapToTicks() Extension method

    Returns 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 method

    Gets the update behavior of a spin button. See gtk_spin_button_set_update_policy().

    Declaration

    Swift

    @inlinable
    func getUpdatePolicy() -> GtkSpinButtonUpdatePolicy
  • getValue() Extension method

    Get the value in the spin_button.

    Declaration

    Swift

    @inlinable
    func getValue() -> Double
  • getValueAsInt() Extension method

    Get the value spin_button represented as an integer.

    Declaration

    Swift

    @inlinable
    func getValueAsInt() -> Int
  • getWrap() Extension method

    Returns 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 with spin_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:page:) Extension method

    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:max:) Extension method

    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:increment:) Extension method

    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 method

    Manually force an update of the spin button.

    Declaration

    Swift

    @inlinable
    func update()
  • 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 method

    Undocumented

    Declaration

    Swift

    @inlinable
    var adjustment: AdjustmentRef! { get nonmutating set }
  • digits Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var digits: Int { get nonmutating set }
  • numeric Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var numeric: Bool { get nonmutating set }
  • snapToTicks Extension method

    Returns 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 method

    Gets 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 method

    Undocumented

    Declaration

    Swift

    @inlinable
    var value: Double { get nonmutating set }
  • valueAsInt Extension method

    Get the value spin_button represented as an integer.

    Declaration

    Swift

    @inlinable
    var valueAsInt: Int { get }
  • wrap Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var wrap: Bool { get nonmutating set }
  • entry Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var entry: GtkEntry { get }