1.62 <GtkEventControllerScroll>

Class: <GtkEventControllerScroll>

It derives from <GtkEventController>.

Handles scroll events.

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

In the case of continuous scroll events, <GtkEventControllerScroll> encloses all event-controller-scroll:scroll emissions between two event-controller-scroll:scroll-begin and event-controller-scroll: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 event-controller-scroll: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 vertical, horizontal and both-axes. If any axis is disabled, the respective event-controller-scroll: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 discrete. This can be used to implement discrete actions triggered through scroll events (e.g. switching across combobox options).

The kinetic flag toggles the emission of the event-controller-scroll:decelerate signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.

Properties

Property: event-controller-scroll:flags self

The flags affecting event controller behavior.

Its value is a <GtkEventControllerScrollFlags> (or, to set it, a list of its symbols, or one of them).

Set it with (set! (event-controller-scroll:flags self) value).

Procedures

Method: event-controller-scroll:get-flags self ⇒ %return
Method: get-flags self ⇒ %return

Gets the flags conditioning the scroll controller behavior.

self

Passed: a <GtkEventControllerScroll>.

a <GtkEventControllerScroll>

%return

Returned: a <GtkEventControllerScrollFlags>.

the controller flags.

Method: event-controller-scroll:get-unit self ⇒ %return
Method: get-unit self ⇒ %return

Gets the scroll unit of the last event-controller-scroll:scroll signal received.

Always returns wheel if the discrete flag is set.

self

Passed: a <GtkEventControllerScroll>.

a <GtkEventControllerScroll>.

%return

Returned: a <GdkScrollUnit>.

the scroll unit.

Procedure: event-controller-scroll:new flags ⇒ %return

Creates a new event controller that will handle scroll events.

flags

Passed: a <GtkEventControllerScrollFlags>, or a list of its symbols, or one of them.

flags affecting the controller behavior

%return

Returned: a <GtkEventController>.

a new <GtkEventControllerScroll>

Method: event-controller-scroll:set-flags self flags
Method: set-flags self flags

Sets the flags conditioning scroll controller behavior.

self

Passed: a <GtkEventControllerScroll>.

a <GtkEventControllerScroll>

flags

Passed: a <GtkEventControllerScrollFlags>, or a list of its symbols, or one of them.

flags affecting the controller behavior

Signals

Signal: event-controller-scroll:decelerate

Connect a handler with (connect object event-controller-scroll:decelerate handler). It is called as (handler self vel-x vel-y).

Emitted after scroll is finished if the kinetic flag is set.

vel-x and vel-y express the initial velocity that was imprinted by the scroll events. vel-x and vel-y are expressed in pixels/ms.

self

Passed: a <GtkEventControllerScroll>.

vel-x

Passed: a real number.

X velocity

vel-y

Passed: a real number.

Y velocity

Signal: event-controller-scroll:scroll

Connect a handler with (connect object event-controller-scroll:scroll handler). It is called as (handler self dx dy) ⇒ %return.

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

For the representation unit of the deltas, see event-controller-scroll:get-unit.

self

Passed: a <GtkEventControllerScroll>.

dx

Passed: a real number.

X delta

dy

Passed: a real number.

Y delta

%return

Returned: a boolean.

#t if the scroll event was handled, #f otherwise.

Signal: event-controller-scroll:scroll-begin

Connect a handler with (connect object event-controller-scroll:scroll-begin handler). It is called as (handler self).

Signals that a new scrolling operation has begun.

It will only be emitted on devices capable of it.

self

Passed: a <GtkEventControllerScroll>.

Signal: event-controller-scroll:scroll-end

Connect a handler with (connect object event-controller-scroll:scroll-end handler). It is called as (handler self).

Signals that a scrolling operation has finished.

It will only be emitted on devices capable of it.

self

Passed: a <GtkEventControllerScroll>.