EventControllerScroll

open class EventControllerScroll(pointer: <Error class: unknown class><<Error class: unknown class>>) : EventController

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 signal@Gtk.EventControllerScroll::scroll signal. Deltas in the discrete case are multiples of 1.

In the case of continuous scroll events, GtkEventControllerScroll encloses all signal@Gtk.EventControllerScroll::scroll emissions between two signal@Gtk.EventControllerScroll::scroll-begin and signal@Gtk.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 method@Gtk.EventControllerScroll.set_flags (e.g. because the scrolling conditions of the widget changed).

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 signal@Gtk.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 signal@Gtk.EventControllerScroll::decelerate signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.

Constructors

Link copied to clipboard
constructor(flags: EventControllerScrollFlags)

Creates a new event controller that will handle scroll events.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The flags affecting event controller behavior.

Link copied to clipboard
val gtkEventControllerPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkEventControllerScrollPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var name: String?

The name for this controller, typically used for debugging purposes.

Link copied to clipboard

The limit for which events this controller will handle.

Link copied to clipboard

The propagation phase at which this controller will handle events.

Link copied to clipboard
open val widget: Widget?

The widget receiving the GdkEvents that the controller will handle.

Functions

Link copied to clipboard
fun connectDecelerate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (velX: Double, velY: Double) -> Unit): <Error class: unknown class>

Emitted after scroll is finished if the %GTK_EVENT_CONTROLLER_SCROLL_KINETIC flag is set.

Link copied to clipboard
fun connectScroll(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (dx: Double, dy: Double) -> Boolean): <Error class: unknown class>

Signals that the widget should scroll by the amount specified by @dx and @dy.

Link copied to clipboard
fun connectScrollBegin(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Signals that a new scrolling operation has begun.

Link copied to clipboard
fun connectScrollEnd(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Signals that a scrolling operation has finished.

Link copied to clipboard
open fun getCurrentEvent(): <Error class: unknown class>?

Returns the event that is currently being handled by the controller.

Link copied to clipboard
open fun getCurrentEventDevice(): <Error class: unknown class>?

Returns the device of the event that is currently being handled by the controller.

Link copied to clipboard
open fun getCurrentEventState(): <Error class: unknown class>

Returns the modifier state of the event that is currently being handled by the controller.

Link copied to clipboard
open fun getCurrentEventTime(): <Error class: unknown class>

Returns the timestamp of the event that is currently being handled by the controller.

Link copied to clipboard

Gets the flags conditioning the scroll controller behavior.

Link copied to clipboard
open fun getName(): String?

Gets the name of @controller.

Link copied to clipboard

Gets the propagation limit of the event controller.

Link copied to clipboard

Gets the propagation phase at which @controller handles events.

Link copied to clipboard
open fun getUnit(): <Error class: unknown class>

Gets the scroll unit of the last signal@Gtk.EventControllerScroll::scroll signal received.

Link copied to clipboard
open fun getWidget(): Widget?

Returns the GtkWidget this controller relates to.

Link copied to clipboard
open fun reset()

Resets the @controller to a clean state.

Link copied to clipboard

Sets the flags conditioning scroll controller behavior.

Link copied to clipboard
open fun setName(name: String? = null)

Sets a name on the controller that can be used for debugging.

Link copied to clipboard

Sets the event propagation limit on the event controller.

Link copied to clipboard

Sets the propagation phase at which a controller handles events.

Link copied to clipboard
open fun setStaticName(name: String? = null)

Sets a name on the controller that can be used for debugging.