Package: gtk

Class gtk-event-controller-scroll

Superclasses

gtk-event-controller, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

flags
The flags property of type gtk-event-controller-scroll-flags (Read / Write)
The flags affecting event controller behavior. Since 3.24

Details

gtk-event-controller-scroll is an event controller meant to handle scroll events from mice and touchpads. It is capable of handling both discrete and continuous scroll events, abstracting them both on the "scroll" signal. Deltas in the discrete case are multiples of 1.

In the case of continuous scroll events, gtk-event-controller-scroll encloses all "scroll" events between two "scroll-begin" and "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 the generic function gtk-event-controller-scroll-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 "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 "decelerate" signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.

This object was added in 3.24.

Signal Details

The "decelerate" signal
  lambda (controller vel-x vel-y)    : Run First      
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. Since 3.24
controller
The gtk-event-controller-scroll object that received the signal.
vel-x
a :double with the x velocity
vel-y
a :double with the y velocity
The "scroll" signal
  lambda (controller dx dy)    : Run First      
Signals that the widget should scroll by the amount specified by dx and dy. Since 3.24
controller
The gtk-event-controller-scroll object that received the signal.
dx
a :double with the x delta
dy
a :double with the y delta
The "scroll-begin" signal
  lambda (controller)    : Run First      
Signals that a new scrolling operation has begun. It will only be emitted on devices capable of it. Since 3.24
controller
The gtk-event-controller-scroll object that received the signal.
The "scroll-end" signal
  lambda (controller)    : Run First      
Signals that a new scrolling operation has finished. It will only be emitted on devices capable of it. Since 3.24
controller
The gtk-event-controller-scroll object that received the signal.
 

Slot Access Functions

Inherited Slot Access Functions

See also

2020-9-10