EventControllerScroll

open class EventControllerScroll : EventController, EventControllerScrollProtocol

GtkEventControllerScroll is an event controller that handles scroll events.

It is capable of handling both discrete and continuous scroll events from mice or touchpads, abstracting them both with the [signalGtk.EventControllerScroll::scroll] signal. Deltas in the discrete case are multiples of 1.

In the case of continuous scroll events, GtkEventControllerScroll encloses all [signalGtk.EventControllerScroll::scroll] emissions between two [signalGtk.EventControllerScroll::scroll-begin] and [signalGtk.EventControllerScroll::scroll-end] signals.

The behavior of the event controller can be modified by the flags given at creation time, or modified at a later point through methodGtk.EventControllerScroll.set_flags.

The controller can be set up to emit motion for either/both vertical and horizontal scroll events through GTK_EVENT_CONTROLLER_SCROLL_VERTICAL, GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL and GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES. If any axis is disabled, the respective [signalGtk.EventControllerScroll::scroll] delta will be 0. Vertical scroll events will be translated to horizontal motion for the devices incapable of horizontal scrolling.

The event controller can also be forced to emit discrete events on all devices through GTK_EVENT_CONTROLLER_SCROLL_DISCRETE. This can be used to implement discrete actions triggered through scroll events (e.g. switching across combobox options).

The GTK_EVENT_CONTROLLER_SCROLL_KINETIC flag toggles the emission of the [signalGtk.EventControllerScroll::decelerate] signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.

The EventControllerScroll type acts as a reference-counted owner of an underlying GtkEventControllerScroll instance. It provides the methods that can operate on this data type through EventControllerScrollProtocol conformance. Use EventControllerScroll as a strong reference or owner of a GtkEventControllerScroll instance.

  • Designated initialiser from the underlying `C` data type.
    

    This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EventControllerScroll instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafeMutablePointer<GtkEventControllerScroll>)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EventControllerScroll instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafePointer<GtkEventControllerScroll>)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a non-mutating gpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EventControllerScroll instance.

    Declaration

    Swift

    @inlinable
    override public init!(gpointer op: gpointer?)

    Parameters

    op

    gpointer to the underlying object

  • Optional initialiser from a non-mutating gconstpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EventControllerScroll instance.

    Declaration

    Swift

    @inlinable
    override public init!(gconstpointer op: gconstpointer?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EventControllerScroll instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafePointer<GtkEventControllerScroll>?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EventControllerScroll instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafeMutablePointer<GtkEventControllerScroll>?)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from the underlying C data type. Will retain GtkEventControllerScroll. i.e., ownership is transferred to the EventControllerScroll instance.

    Declaration

    Swift

    @inlinable
    public init(retaining op: UnsafeMutablePointer<GtkEventControllerScroll>)

    Parameters

    op

    pointer to the underlying object

  • Reference intialiser for a related type that implements EventControllerScrollProtocol Will retain GtkEventControllerScroll.

    Declaration

    Swift

    @inlinable
    public init<T>(eventControllerScroll other: T) where T : EventControllerScrollProtocol

    Parameters

    other

    an instance of a related type that implements EventControllerScrollProtocol

  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(cPointer p: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    override public init(raw p: UnsafeRawPointer)

    Parameters

    p

    raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingRaw raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    public required init(raw p: UnsafeMutableRawPointer)

    Parameters

    p

    mutable raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    required public init(retainingRaw raw: UnsafeMutableRawPointer)

    Parameters

    raw

    mutable raw pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    override public init(opaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EventControllerScrollProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingOpaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Creates a new event controller that will handle scroll events.

    Declaration

    Swift

    @inlinable
    public init(flags: EventControllerScrollFlags)