ScrollbarRef
public struct ScrollbarRef : ScrollbarProtocol, GWeakCapturing
The GtkScrollbar
widget is a horizontal or vertical scrollbar.
Its position and movement are controlled by the adjustment that is passed to
or created by [ctorGtk.Scrollbar.new
]. See [classGtk.Adjustment
] for more
details. The [propertyGtk.Adjustment:value
] field sets the position of the
thumb and must be between [propertyGtk.Adjustment:lower
] and
[propertyGtk.Adjustment:upper
] - [propertyGtk.Adjustment:page-size
].
The [propertyGtk.Adjustment:page-size
] represents the size of the visible
scrollable area.
The fields [propertyGtk.Adjustment:step-increment
] and
[propertyGtk.Adjustment:page-increment
] fields are added to or subtracted
from the [propertyGtk.Adjustment:value
] when the user asks to move by a step
(using e.g. the cursor arrow keys) or by a page (using e.g. the Page Down/Up
keys).
CSS nodes
scrollbar
╰── range[.fine-tune]
╰── trough
╰── slider
GtkScrollbar
has a main CSS node with name scrollbar and a subnode for its
contents. The main node gets the .horizontal or .vertical style classes applied,
depending on the scrollbar’s orientation.
The range node gets the style class .fine-tune added when the scrollbar is in ‘fine-tuning’ mode.
Other style classes that may be added to scrollbars inside
[classGtk.ScrolledWindow
] include the positional classes (.left, .right,
.top, .bottom) and style classes related to overlay scrolling (.overlay-indicator,
.dragging, .hovering).
Accessibility
GtkScrollbar
uses the GTK_ACCESSIBLE_ROLE_SCROLLBAR
role.
The ScrollbarRef
type acts as a lightweight Swift reference to an underlying GtkScrollbar
instance.
It exposes methods that can operate on this data type through ScrollbarProtocol
conformance.
Use ScrollbarRef
only as an unowned
reference to an existing GtkScrollbar
instance.
-
Untyped pointer to the underlying `GtkScrollbar` instance.
For type-safe access, use the generated, typed pointer
scrollbar_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkScrollbar>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkScrollbar>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkScrollbar>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkScrollbar>?)
-
Conditional initialiser from an optional
gpointer
Declaration
Swift
@inlinable init!(gpointer g: gpointer?)
-
Conditional initialiser from an optional, non-mutable
gconstpointer
Declaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?)
-
Reference intialiser for a related type that implements
ScrollbarProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : ScrollbarProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> ScrollbarRef where T : ScrollbarProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ScrollbarProtocol
.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>)
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ScrollbarProtocol
.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ScrollbarProtocol
.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ScrollbarProtocol
.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ScrollbarProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a new scrollbar with the given orientation.
Declaration
Swift
@inlinable init<AdjustmentT>(orientation: GtkOrientation, adjustment: AdjustmentT?) where AdjustmentT : AdjustmentProtocol