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
GtkAdjustment
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
adjustment_ptr
Default implementationTyped 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)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) 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 transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a 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:
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
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
AdjustmentSignalName
signalDeclaration
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 byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
AdjustmentSignalName
signalDeclaration
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 byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onChanged(flags:
Extension methodhandler: ) Emitted when one or more of the
GtkAdjustment
properties have been changed, other than theGtkAdjustment:value
property.Note
This represents the underlyingchanged
signalDeclaration
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 methodTyped
changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var changedSignal: AdjustmentSignalName { get }
-
onValueChanged(flags:
Extension methodhandler: ) Emitted when the
GtkAdjustment:value
property has been changed.Note
This represents the underlyingvalue-changed
signalDeclaration
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 methodTyped
value-changed
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::lower
signalDeclaration
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 methodTyped
notify::lower
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::page-increment
signalDeclaration
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 methodTyped
notify::page-increment
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::page-size
signalDeclaration
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 methodTyped
notify::page-size
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::step-increment
signalDeclaration
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 methodTyped
notify::step-increment
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::upper
signalDeclaration
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 methodTyped
notify::upper
signal 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 innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::value
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyValue(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: 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 methodTyped
notify::value
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyValueSignal: AdjustmentSignalName { get }
-
changed()
Extension methodEmits a
GtkAdjustment::changed
signal from theGtkAdjustment
. This is typically called by the owner of theGtkAdjustment
after it has changed any of theGtkAdjustment
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:
Extension methodupper: ) Updates the
GtkAdjustment:value
property to ensure that the range betweenlower
andupper
is in the current page (i.e. betweenGtkAdjustment:value
andGtkAdjustment: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)
-
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::changed
signal. Seegtk_adjustment_set_lower()
for an alternative way of compressing multiple emissions ofGtkAdjustment::changed
into 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::changed
signals will be emitted. However, since the emission of theGtkAdjustment::changed
signal is tied to the emission of theGObject::notify
signals of the changed properties, it’s possible to compress theGtkAdjustment::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 usinggtk_adjustment_configure()
has the same effect of compressingGtkAdjustment::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 theGtkAdjustment::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 theGtkAdjustment::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 theGtkAdjustment::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 betweenGtkAdjustment:lower
andGtkAdjustment:upper
.Note that for adjustments which are used in a
GtkScrollbar
, the effective range of allowed values goes fromGtkAdjustment:lower
toGtkAdjustment:upper
-GtkAdjustment:page-size
.Declaration
Swift
@inlinable func set(value: Double)
-
valueChanged()
Extension methodEmits a
GtkAdjustment::value-changed
signal from theGtkAdjustment
. This is typically called by the owner of theGtkAdjustment
after it has changed theGtkAdjustment: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 methodThe minimum value of the adjustment.
Declaration
Swift
@inlinable var lower: Double { get nonmutating set }
-
minimumIncrement
Extension methodGets the smaller of step increment and page increment.
Declaration
Swift
@inlinable var minimumIncrement: Double { get }
-
pageIncrement
Extension methodRetrieves the page increment of the adjustment.
Declaration
Swift
@inlinable var pageIncrement: Double { get nonmutating set }
-
pageSize
Extension methodRetrieves the page size of the adjustment.
Declaration
Swift
@inlinable var pageSize: Double { get nonmutating set }
-
stepIncrement
Extension methodRetrieves the step increment of the adjustment.
Declaration
Swift
@inlinable var stepIncrement: Double { get nonmutating set }
-
upper
Extension methodThe 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 methodThe value of the adjustment.
Declaration
Swift
@inlinable var value: Double { get nonmutating set }
-
parentInstance
Extension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GInitiallyUnowned { get }