ScrollbarRef

public struct ScrollbarRef : ScrollbarProtocol, GWeakCapturing

The GtkScrollbar widget is a horizontal or vertical scrollbar, depending on the value of the GtkOrientable:orientation property.

Its position and movement are controlled by the adjustment that is passed to or created by gtk_scrollbar_new(). See GtkAdjustment for more details. The GtkAdjustment:value field sets the position of the thumb and must be between GtkAdjustment:lower and GtkAdjustment:upper - GtkAdjustment:page-size. The GtkAdjustment:page-size represents the size of the visible scrollable area. The fields GtkAdjustment:step-increment and GtkAdjustment:page-increment fields are added to or subtracted from the GtkAdjustment:value when the user asks to move by a step (using e.g. the cursor arrow keys or, if present, the stepper buttons) or by a page (using e.g. the Page Down/Up keys).

CSS nodes

(plain Language Example):

scrollbar[.fine-tune]
╰── contents
    ├── [button.up]
    ├── [button.down]
    ├── trough
    │   ╰── slider
    ├── [button.up]
    ╰── [button.down]

GtkScrollbar has a main CSS node with name scrollbar and a subnode for its contents, with subnodes named trough and slider.

The main node gets the style class .fine-tune added when the scrollbar is in ‘fine-tuning’ mode.

If steppers are enabled, they are represented by up to four additional subnodes with name button. These get the style classes .up and .down to indicate in which direction they are moving.

Other style classes that may be added to scrollbars inside GtkScrolledWindow include the positional classes (.left, .right, .top, .bottom) and style classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering).

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.

  • ptr
    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!

Scrollbar Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkScrollbar>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkScrollbar>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkScrollbar>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    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