ScrollableRef

public struct ScrollableRef : ScrollableProtocol

GtkScrollable is an interface for widgets with native scrolling ability.

To implement this interface you should override the [propertyGtk.Scrollable:hadjustment] and [propertyGtk.Scrollable:vadjustment] properties.

Creating a scrollable widget

All scrollable widgets should do the following.

  • When a parent widget sets the scrollable child widget’s adjustments, the widget should populate the adjustments’ [propertyGtk.Adjustment:lower], [propertyGtk.Adjustment:upper], [propertyGtk.Adjustment:step-increment], [propertyGtk.Adjustment:page-increment] and [propertyGtk.Adjustment:page-size] properties and connect to the [signalGtk.Adjustment::value-changed] signal.

  • Because its preferred size is the size for a fully expanded widget, the scrollable widget must be able to cope with underallocations. This means that it must accept any value passed to its [vfuncGtk.Widget.size_allocate] implementation.

  • When the parent allocates space to the scrollable child widget, the widget should update the adjustments’ properties with new values.

  • When any of the adjustments emits the [signalGtk.Adjustment::value-changed] signal, the scrollable widget should scroll its contents.

The ScrollableRef type acts as a lightweight Swift reference to an underlying GtkScrollable instance. It exposes methods that can operate on this data type through ScrollableProtocol conformance. Use ScrollableRef only as an unowned reference to an existing GtkScrollable instance.

  • ptr
    Untyped pointer to the underlying `GtkScrollable` instance.
    

    For type-safe access, use the generated, typed pointer scrollable_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Scrollable Interface

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkScrollable>?)
  • 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 ScrollableProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : ScrollableProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ScrollableProtocol.

    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 ScrollableProtocol.

    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 ScrollableProtocol.

    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 ScrollableProtocol.

    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 ScrollableProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)