Class

GtkEventControllerScroll

Description [src]

final class Gtk.EventControllerScroll : Gtk.EventController
{
  /* No available fields */
}

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

In the case of continuous scroll events, GtkEventControllerScroll encloses all GtkEventControllerScroll::scroll emissions between two GtkEventControllerScroll::scroll-begin and GtkEventControllerScroll::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 gtk_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 GTK_EVENT_CONTROLLER_SCROLL_VERTICAL, GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL and GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES. If any axis is disabled, the respective GtkEventControllerScroll::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 GtkEventControllerScroll::decelerate signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.

Hierarchy

hierarchy this GtkEventControllerScroll ancestor_0 GtkEventController ancestor_0--this ancestor_1 GObject ancestor_1--ancestor_0

Constructors

gtk_event_controller_scroll_new

Creates a new event controller that will handle scroll events.

Instance methods

gtk_event_controller_scroll_get_flags

Gets the flags conditioning the scroll controller behavior.

gtk_event_controller_scroll_get_unit

Gets the scroll unit of the last GtkEventControllerScroll::scroll signal received.

since: 4.8

gtk_event_controller_scroll_set_flags

Sets the flags conditioning scroll controller behavior.

Methods inherited from GtkEventController (13)
gtk_event_controller_get_current_event

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

gtk_event_controller_get_current_event_device

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

gtk_event_controller_get_current_event_state

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

gtk_event_controller_get_current_event_time

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

gtk_event_controller_get_name

Gets the name of controller.

gtk_event_controller_get_propagation_limit

Gets the propagation limit of the event controller.

gtk_event_controller_get_propagation_phase

Gets the propagation phase at which controller handles events.

gtk_event_controller_get_widget

Returns the GtkWidget this controller relates to.

gtk_event_controller_reset

Resets the controller to a clean state.

gtk_event_controller_set_name

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

gtk_event_controller_set_propagation_limit

Sets the event propagation limit on the event controller.

gtk_event_controller_set_propagation_phase

Sets the propagation phase at which a controller handles events.

gtk_event_controller_set_static_name

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

since: 4.8

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Gtk.EventControllerScroll:flags

The flags affecting event controller behavior.

Properties inherited from GtkEventController (4)
Gtk.EventController:name

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

Gtk.EventController:propagation-limit

The limit for which events this controller will handle.

Gtk.EventController:propagation-phase

The propagation phase at which this controller will handle events.

Gtk.EventController:widget

The widget receiving the GdkEvents that the controller will handle.

Signals

Gtk.EventControllerScroll::decelerate

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

Gtk.EventControllerScroll::scroll

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

Gtk.EventControllerScroll::scroll-begin

Signals that a new scrolling operation has begun.

Gtk.EventControllerScroll::scroll-end

Signals that a scrolling operation has finished.

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct GtkEventControllerScrollClass {
  /* no available fields */
}

No description available.