AdjustmentProtocol
public protocol AdjustmentProtocol : InitiallyUnownedProtocol
GtkAdjustment is a model for a numeric value.
The `GtkAdjustment has an associated lower and upper bound. It also contains step and page increments, and a page size.
Adjustments are used within several GTK widgets, including
[classGtk.SpinButton], [classGtk.Viewport], [classGtk.Scrollbar]
and [classGtk.Scale].
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.
-
Untyped pointer to the underlying
GtkAdjustmentinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
adjustment_ptrDefault implementationTyped pointer to the underlying
GtkAdjustmentinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkAdjustmentinstance.Declaration
Swift
var adjustment_ptr: UnsafeMutablePointer<GtkAdjustment>! { get } -
Required Initialiser for types conforming to
AdjustmentProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
AdjustmentPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Adjustment property
Declaration
Swift
@inlinable func get(property: AdjustmentPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a 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
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
AdjustmentSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: AdjustmentSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
AdjustmentSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: AdjustmentSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onChanged(flags:Extension methodhandler: ) Emitted when one or more of the
GtkAdjustmentproperties have been changed.Note that the [property
Gtk.Adjustment:value] property is covered by the [signalGtk.Adjustment::value-changed] signal.Note
This represents the underlyingchangedsignalDeclaration
Swift
@discardableResult @inlinable func onChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
changedsignal is emitted -
changedSignalExtension methodTyped
changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var changedSignal: AdjustmentSignalName { get } -
onValueChanged(flags:Extension methodhandler: ) Emitted when the value has been changed.
Note
This represents the underlyingvalue-changedsignalDeclaration
Swift
@discardableResult @inlinable func onValueChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
valueChangedsignal is emitted -
valueChangedSignalExtension methodTyped
value-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var valueChangedSignal: AdjustmentSignalName { get } -
onNotifyLower(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::lowersignalDeclaration
Swift
@discardableResult @inlinable func onNotifyLower(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyLowersignal is emitted -
notifyLowerSignalExtension methodTyped
notify::lowersignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyLowerSignal: AdjustmentSignalName { get } -
onNotifyPageIncrement(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::page-incrementsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPageIncrement(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyPageIncrementsignal is emitted -
notifyPageIncrementSignalExtension methodTyped
notify::page-incrementsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPageIncrementSignal: AdjustmentSignalName { get } -
onNotifyPageSize(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::page-sizesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPageSize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyPageSizesignal is emitted -
notifyPageSizeSignalExtension methodTyped
notify::page-sizesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPageSizeSignal: AdjustmentSignalName { get } -
onNotifyStepIncrement(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::step-incrementsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyStepIncrement(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyStepIncrementsignal is emitted -
notifyStepIncrementSignalExtension methodTyped
notify::step-incrementsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyStepIncrementSignal: AdjustmentSignalName { get } -
onNotifyUpper(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::uppersignalDeclaration
Swift
@discardableResult @inlinable func onNotifyUpper(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyUppersignal is emitted -
notifyUpperSignalExtension methodTyped
notify::uppersignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyUpperSignal: AdjustmentSignalName { get } -
onNotifyValue(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::valuesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyValue(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AdjustmentRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyValuesignal is emitted -
notifyValueSignalExtension methodTyped
notify::valuesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyValueSignal: AdjustmentSignalName { get }
-
clampPage(lower:Extension methodupper: ) Updates the value property to ensure that the range between
lowerandupperis in the current page.The current page goes from
valuetovalue+page-size. If the range is larger than the page size, then only the start of it will be in the current page.A [signal
Gtk.Adjustment::value-changed] signal will be emitted if the value is changed.Declaration
Swift
@inlinable func clampPage(lower: CDouble, upper: CDouble) -
configure(value:Extension methodlower: upper: stepIncrement: pageIncrement: pageSize: ) Sets all properties of the adjustment at once.
Use this function to avoid multiple emissions of the [signal
Gtk.Adjustment::changed] signal. See [methodGtk.Adjustment.set_lower] for an alternative way of compressing multiple emissions of [signalGtk.Adjustment::changed] into one.Declaration
Swift
@inlinable func configure(value: CDouble, lower: CDouble, upper: CDouble, stepIncrement: CDouble, pageIncrement: CDouble, pageSize: CDouble) -
getLower()Extension methodRetrieves the minimum value of the adjustment.
Declaration
Swift
@inlinable func getLower() -> CDouble -
getMinimumIncrement()Extension methodGets the smaller of step increment and page increment.
Declaration
Swift
@inlinable func getMinimumIncrement() -> CDouble -
getPageIncrement()Extension methodRetrieves the page increment of the adjustment.
Declaration
Swift
@inlinable func getPageIncrement() -> CDouble -
getPageSize()Extension methodRetrieves the page size of the adjustment.
Declaration
Swift
@inlinable func getPageSize() -> CDouble -
getStepIncrement()Extension methodRetrieves the step increment of the adjustment.
Declaration
Swift
@inlinable func getStepIncrement() -> CDouble -
getUpper()Extension methodRetrieves the maximum value of the adjustment.
Declaration
Swift
@inlinable func getUpper() -> CDouble -
getValue()Extension methodGets the current value of the adjustment.
Declaration
Swift
@inlinable func getValue() -> CDouble -
set(lower:Extension method) Sets the minimum value of the adjustment.
When setting multiple adjustment properties via their individual setters, multiple [signal
Gtk.Adjustment::changed] signals will be emitted. However, since the emission of the [signalGtk.Adjustment::changed] signal is tied to the emission of thenotifysignals of the changed properties, it’s possible to compress the [signalGtk.Adjustment::changed] signals into one by callingg_object_freeze_notify()andg_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 [methodGtk.Adjustment.configure] has the same effect.Declaration
Swift
@inlinable func set(lower: CDouble) -
set(pageIncrement:Extension method) Sets the page increment of the adjustment.
See [method
Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signalGtk.Adjustment::changed] signal when setting multiple adjustment properties.Declaration
Swift
@inlinable func set(pageIncrement: CDouble) -
set(pageSize:Extension method) Sets the page size of the adjustment.
See [method
Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signalGtk.Adjustment::changed] signal when setting multiple adjustment properties.Declaration
Swift
@inlinable func set(pageSize: CDouble) -
set(stepIncrement:Extension method) Sets the step increment of the adjustment.
See [method
Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signalGtk.Adjustment::changed] signal when setting multiple adjustment properties.Declaration
Swift
@inlinable func set(stepIncrement: CDouble) -
set(upper:Extension method) Sets the maximum value of the adjustment.
Note that values will be restricted by
upper - page-sizeif the page-size property is nonzero.See [method
Gtk.Adjustment.set_lower] about how to compress multiple emissions of the [signalGtk.Adjustment::changed] signal when setting multiple adjustment properties.Declaration
Swift
@inlinable func set(upper: CDouble) -
set(value:Extension method) Sets the
GtkAdjustmentvalue.The value is clamped to lie between [property
Gtk.Adjustment:lower] and [propertyGtk.Adjustment:upper].Note that for adjustments which are used in a
GtkScrollbar, the effective range of allowed values goes from [propertyGtk.Adjustment:lower] to [propertyGtk.Adjustment:upper] - [propertyGtk.Adjustment:page-size].Declaration
Swift
@inlinable func set(value: CDouble) -
lowerExtension methodThe minimum value of the adjustment.
Declaration
Swift
@inlinable var lower: CDouble { get nonmutating set } -
minimumIncrementExtension methodGets the smaller of step increment and page increment.
Declaration
Swift
@inlinable var minimumIncrement: CDouble { get } -
pageIncrementExtension methodRetrieves the page increment of the adjustment.
Declaration
Swift
@inlinable var pageIncrement: CDouble { get nonmutating set } -
pageSizeExtension methodRetrieves the page size of the adjustment.
Declaration
Swift
@inlinable var pageSize: CDouble { get nonmutating set } -
stepIncrementExtension methodRetrieves the step increment of the adjustment.
Declaration
Swift
@inlinable var stepIncrement: CDouble { get nonmutating set } -
upperExtension methodThe maximum value of the adjustment.
Note that values will be restricted by
upper - page-sizeif the page-size property is nonzero.Declaration
Swift
@inlinable var upper: CDouble { get nonmutating set } -
valueExtension methodThe value of the adjustment.
Declaration
Swift
@inlinable var value: CDouble { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GInitiallyUnowned { get }
View on GitHub
Install in Dash
AdjustmentProtocol Protocol Reference