AdjustmentProtocol

public protocol AdjustmentProtocol : InitiallyUnownedProtocol

The GtkAdjustment object represents a value which has an associated lower and upper bound, together with step and page increments, and a page size. It is used within several GTK+ widgets, including GtkSpinButton, GtkViewport, and GtkRange (which is a base class for GtkScrollbar and GtkScale).

The GtkAdjustment object does not update the value itself. Instead it is left up to the owner of the GtkAdjustment to control the value.

The AdjustmentProtocol protocol exposes the methods and properties of an underlying GtkAdjustment 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 Adjustment. Alternatively, use AdjustmentRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkAdjustment instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkAdjustment instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkAdjustment instance.

    Declaration

    Swift

    var adjustment_ptr: UnsafeMutablePointer<GtkAdjustment>! { get }
  • Required Initialiser for types conforming to AdjustmentProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Adjustment Class

  • Bind a AdjustmentPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: AdjustmentPropertyName, 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 Adjustment property

    Declaration

    Swift

    @inlinable
    func get(property: AdjustmentPropertyName) -> 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 Adjustment property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: AdjustmentPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

Adjustment signals

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

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: AdjustmentSignalName, 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 AdjustmentSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: AdjustmentSignalName, 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)

  • onChanged(flags:handler:) Extension method

    Emitted when one or more of the GtkAdjustment properties have been changed, other than the GtkAdjustment:value property.

    Note

    This represents the underlying changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • changedSignal Extension method

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

    Declaration

    Swift

    static var changedSignal: AdjustmentSignalName { get }
  • Emitted when the GtkAdjustment:value property has been changed.

    Note

    This represents the underlying value-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onValueChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef) -> 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: AdjustmentSignalName { 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::lower signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyLower(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ 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 notifyLower signal is emitted

  • notifyLowerSignal Extension method

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

    Declaration

    Swift

    static var notifyLowerSignal: AdjustmentSignalName { 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::page-increment signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyPageIncrement(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ 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 notifyPageIncrement signal is emitted

  • notifyPageIncrementSignal Extension method

    Typed notify::page-increment signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPageIncrementSignal: AdjustmentSignalName { 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::page-size signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyPageSize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ 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 notifyPageSize signal is emitted

  • notifyPageSizeSignal Extension method

    Typed notify::page-size signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPageSizeSignal: AdjustmentSignalName { 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::step-increment signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyStepIncrement(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ 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 notifyStepIncrement signal is emitted

  • notifyStepIncrementSignal Extension method

    Typed notify::step-increment signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyStepIncrementSignal: AdjustmentSignalName { 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::upper signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyUpper(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ 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 notifyUpper signal is emitted

  • notifyUpperSignal Extension method

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

    Declaration

    Swift

    static var notifyUpperSignal: AdjustmentSignalName { 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: AdjustmentRef, _ 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: AdjustmentSignalName { get }

Adjustment Class: AdjustmentProtocol extension (methods and fields)

  • changed() Extension method

    Emits a GtkAdjustment::changed signal from the GtkAdjustment. This is typically called by the owner of the GtkAdjustment after it has changed any of the GtkAdjustment properties other than the value.

    changed is deprecated: GTK+ emits #GtkAdjustment::changed itself whenever any of the properties (other than value) change

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func changed()
  • clampPage(lower:upper:) Extension method

    Updates the GtkAdjustment:value property to ensure that the range between lower and upper is in the current page (i.e. between GtkAdjustment:value and GtkAdjustment:value + GtkAdjustment:page-size). If the range is larger than the page size, then only the start of it will be in the current page.

    A GtkAdjustment::value-changed signal will be emitted if the value is changed.

    Declaration

    Swift

    @inlinable
    func clampPage(lower: Double, upper: Double)
  • Sets all properties of the adjustment at once.

    Use this function to avoid multiple emissions of the GtkAdjustment::changed signal. See gtk_adjustment_set_lower() for an alternative way of compressing multiple emissions of GtkAdjustment::changed into one.

    Declaration

    Swift

    @inlinable
    func configure(value: Double, lower: Double, upper: Double, stepIncrement: Double, pageIncrement: Double, pageSize: Double)
  • getLower() Extension method

    Retrieves the minimum value of the adjustment.

    Declaration

    Swift

    @inlinable
    func getLower() -> Double
  • getMinimumIncrement() Extension method

    Gets the smaller of step increment and page increment.

    Declaration

    Swift

    @inlinable
    func getMinimumIncrement() -> Double
  • getPageIncrement() Extension method

    Retrieves the page increment of the adjustment.

    Declaration

    Swift

    @inlinable
    func getPageIncrement() -> Double
  • getPageSize() Extension method

    Retrieves the page size of the adjustment.

    Declaration

    Swift

    @inlinable
    func getPageSize() -> Double
  • getStepIncrement() Extension method

    Retrieves the step increment of the adjustment.

    Declaration

    Swift

    @inlinable
    func getStepIncrement() -> Double
  • getUpper() Extension method

    Retrieves the maximum value of the adjustment.

    Declaration

    Swift

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

    Gets the current value of the adjustment. See gtk_adjustment_set_value().

    Declaration

    Swift

    @inlinable
    func getValue() -> Double
  • set(lower:) Extension method

    Sets the minimum value of the adjustment.

    When setting multiple adjustment properties via their individual setters, multiple GtkAdjustment::changed signals will be emitted. However, since the emission of the GtkAdjustment::changed signal is tied to the emission of the GObject::notify signals of the changed properties, it’s possible to compress the GtkAdjustment::changed signals into one by calling g_object_freeze_notify() and g_object_thaw_notify() around the calls to the individual setters.

    Alternatively, using a single g_object_set() for all the properties to change, or using gtk_adjustment_configure() has the same effect of compressing GtkAdjustment::changed emissions.

    Declaration

    Swift

    @inlinable
    func set(lower: Double)
  • set(pageIncrement:) Extension method

    Sets the page increment of the adjustment.

    See gtk_adjustment_set_lower() about how to compress multiple emissions of the GtkAdjustment::changed signal when setting multiple adjustment properties.

    Declaration

    Swift

    @inlinable
    func set(pageIncrement: Double)
  • set(pageSize:) Extension method

    Sets the page size of the adjustment.

    See gtk_adjustment_set_lower() about how to compress multiple emissions of the GtkAdjustmentchanged signal when setting multiple adjustment properties.

    Declaration

    Swift

    @inlinable
    func set(pageSize: Double)
  • set(stepIncrement:) Extension method

    Sets the step increment of the adjustment.

    See gtk_adjustment_set_lower() about how to compress multiple emissions of the GtkAdjustment::changed signal when setting multiple adjustment properties.

    Declaration

    Swift

    @inlinable
    func set(stepIncrement: Double)
  • set(upper:) Extension method

    Sets the maximum value of the adjustment.

    Note that values will be restricted by upper - page-size if the page-size property is nonzero.

    See gtk_adjustment_set_lower() about how to compress multiple emissions of the GtkAdjustment::changed signal when setting multiple adjustment properties.

    Declaration

    Swift

    @inlinable
    func set(upper: Double)
  • set(value:) Extension method

    Sets the GtkAdjustment value. The value is clamped to lie between GtkAdjustment:lower and GtkAdjustment:upper.

    Note that for adjustments which are used in a GtkScrollbar, the effective range of allowed values goes from GtkAdjustment:lower to GtkAdjustment:upper - GtkAdjustment:page-size.

    Declaration

    Swift

    @inlinable
    func set(value: Double)
  • valueChanged() Extension method

    Emits a GtkAdjustment::value-changed signal from the GtkAdjustment. This is typically called by the owner of the GtkAdjustment after it has changed the GtkAdjustment:value property.

    value_changed is deprecated: GTK+ emits #GtkAdjustment::value-changed itself whenever the value changes

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func valueChanged()
  • lower Extension method

    The minimum value of the adjustment.

    Declaration

    Swift

    @inlinable
    var lower: Double { get nonmutating set }
  • minimumIncrement Extension method

    Gets the smaller of step increment and page increment.

    Declaration

    Swift

    @inlinable
    var minimumIncrement: Double { get }
  • pageIncrement Extension method

    Retrieves the page increment of the adjustment.

    Declaration

    Swift

    @inlinable
    var pageIncrement: Double { get nonmutating set }
  • pageSize Extension method

    Retrieves the page size of the adjustment.

    Declaration

    Swift

    @inlinable
    var pageSize: Double { get nonmutating set }
  • stepIncrement Extension method

    Retrieves the step increment of the adjustment.

    Declaration

    Swift

    @inlinable
    var stepIncrement: Double { get nonmutating set }
  • upper Extension method

    The maximum value of the adjustment. Note that values will be restricted by upper - page-size if the page-size property is nonzero.

    Declaration

    Swift

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

    The value of the adjustment.

    Declaration

    Swift

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

    Undocumented

    Declaration

    Swift

    @inlinable
    var parentInstance: GInitiallyUnowned { get }