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.
-
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, other than theGtkAdjustment:valueproperty.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
GtkAdjustment:valueproperty 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 }
-
changed()Extension methodEmits a
GtkAdjustment::changedsignal from theGtkAdjustment. This is typically called by the owner of theGtkAdjustmentafter it has changed any of theGtkAdjustmentproperties 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:Extension methodupper: ) Updates the
GtkAdjustment:valueproperty to ensure that the range betweenlowerandupperis in the current page (i.e. betweenGtkAdjustment:valueandGtkAdjustment: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-changedsignal will be emitted if the value is changed.Declaration
Swift
@inlinable func clampPage(lower: Double, upper: Double) -
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
GtkAdjustment::changedsignal. Seegtk_adjustment_set_lower()for an alternative way of compressing multiple emissions ofGtkAdjustment::changedinto one.Declaration
Swift
@inlinable func configure(value: Double, lower: Double, upper: Double, stepIncrement: Double, pageIncrement: Double, pageSize: Double) -
getLower()Extension methodRetrieves the minimum value of the adjustment.
Declaration
Swift
@inlinable func getLower() -> Double -
getMinimumIncrement()Extension methodGets the smaller of step increment and page increment.
Declaration
Swift
@inlinable func getMinimumIncrement() -> Double -
getPageIncrement()Extension methodRetrieves the page increment of the adjustment.
Declaration
Swift
@inlinable func getPageIncrement() -> Double -
getPageSize()Extension methodRetrieves the page size of the adjustment.
Declaration
Swift
@inlinable func getPageSize() -> Double -
getStepIncrement()Extension methodRetrieves the step increment of the adjustment.
Declaration
Swift
@inlinable func getStepIncrement() -> Double -
getUpper()Extension methodRetrieves the maximum value of the adjustment.
Declaration
Swift
@inlinable func getUpper() -> Double -
getValue()Extension methodGets 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::changedsignals will be emitted. However, since the emission of theGtkAdjustment::changedsignal is tied to the emission of theGObject::notifysignals of the changed properties, it’s possible to compress theGtkAdjustment::changedsignals 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 usinggtk_adjustment_configure()has the same effect of compressingGtkAdjustment::changedemissions.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 theGtkAdjustment::changedsignal 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 GtkAdjustmentchangedsignal 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 theGtkAdjustment::changedsignal 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-sizeif the page-size property is nonzero.See
gtk_adjustment_set_lower()about how to compress multiple emissions of theGtkAdjustment::changedsignal when setting multiple adjustment properties.Declaration
Swift
@inlinable func set(upper: Double) -
set(value:Extension method) Sets the
GtkAdjustmentvalue. The value is clamped to lie betweenGtkAdjustment:lowerandGtkAdjustment:upper.Note that for adjustments which are used in a
GtkScrollbar, the effective range of allowed values goes fromGtkAdjustment:lowertoGtkAdjustment:upper-GtkAdjustment:page-size.Declaration
Swift
@inlinable func set(value: Double) -
valueChanged()Extension methodEmits a
GtkAdjustment::value-changedsignal from theGtkAdjustment. This is typically called by the owner of theGtkAdjustmentafter it has changed theGtkAdjustment:valueproperty.value_changed is deprecated: GTK+ emits #GtkAdjustment::value-changed itself whenever the value changes
Declaration
Swift
@available(*, deprecated) @inlinable func valueChanged() -
lowerExtension methodThe minimum value of the adjustment.
Declaration
Swift
@inlinable var lower: Double { get nonmutating set } -
minimumIncrementExtension methodGets the smaller of step increment and page increment.
Declaration
Swift
@inlinable var minimumIncrement: Double { get } -
pageIncrementExtension methodRetrieves the page increment of the adjustment.
Declaration
Swift
@inlinable var pageIncrement: Double { get nonmutating set } -
pageSizeExtension methodRetrieves the page size of the adjustment.
Declaration
Swift
@inlinable var pageSize: Double { get nonmutating set } -
stepIncrementExtension methodRetrieves the step increment of the adjustment.
Declaration
Swift
@inlinable var stepIncrement: Double { 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: Double { get nonmutating set } -
valueExtension methodThe value of the adjustment.
Declaration
Swift
@inlinable var value: Double { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GInitiallyUnowned { get }
View on GitHub
Install in Dash
AdjustmentProtocol Protocol Reference