Gtk.EventControllerScroll¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Flags |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted after scroll is finished if the |
|
Signals that the widget should scroll by the amount specified by dx and dy. |
|
Signals that a new scrolling operation has begun. |
|
Signals that a new scrolling operation has finished. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.EventControllerScroll(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Gtk.EventControllerScroll
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 theGtk.EventControllerScroll
::scroll
signal (deltas in the discrete case are multiples of 1).In the case of continuous scroll events,
Gtk.EventControllerScroll
encloses allGtk.EventControllerScroll
::scroll
events between twoGtk.EventControllerScroll
::scroll-begin
andGtk.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
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.EventControllerScrollFlags.VERTICAL
,Gtk.EventControllerScrollFlags.HORIZONTAL
and #GTK_EVENT_CONTROLLER_SCROLL_BOTH. If any axis is disabled, the respectiveGtk.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.EventControllerScrollFlags.DISCRETE
. This can be used to implement discrete actions triggered through scroll events (e.g. switching across combobox options).The
Gtk.EventControllerScrollFlags.KINETIC
flag toggles the emission of theGtk.EventControllerScroll
::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.
- classmethod new(widget, flags)[source]¶
- Parameters:
widget (
Gtk.Widget
) – aGtk.Widget
flags (
Gtk.EventControllerScrollFlags
) – behavior flags
- Returns:
- Return type:
Creates a new event controller that will handle scroll events for the given widget.
New in version 3.24.
- get_flags()[source]¶
- Returns:
the controller flags.
- Return type:
Gets the flags conditioning the scroll controller behavior.
New in version 3.24.
- set_flags(flags)[source]¶
- Parameters:
flags (
Gtk.EventControllerScrollFlags
) – behavior flags
Sets the flags conditioning scroll controller behavior.
New in version 3.24.
Signal Details¶
- Gtk.EventControllerScroll.signals.decelerate(event_controller_scroll, vel_x, vel_y)¶
- Signal Name:
decelerate
- Flags:
- Parameters:
event_controller_scroll (
Gtk.EventControllerScroll
) – The object which received the signalvel_x (
float
) – X velocityvel_y (
float
) – Y velocity
Emitted after scroll is finished if the
Gtk.EventControllerScrollFlags.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.
- Gtk.EventControllerScroll.signals.scroll(event_controller_scroll, dx, dy)¶
- Signal Name:
scroll
- Flags:
- Parameters:
event_controller_scroll (
Gtk.EventControllerScroll
) – The object which received the signaldx (
float
) – X deltady (
float
) – Y delta
Signals that the widget should scroll by the amount specified by dx and dy.
- Gtk.EventControllerScroll.signals.scroll_begin(event_controller_scroll)¶
- Signal Name:
scroll-begin
- Flags:
- Parameters:
event_controller_scroll (
Gtk.EventControllerScroll
) – The object which received the signal
Signals that a new scrolling operation has begun. It will only be emitted on devices capable of it.
- Gtk.EventControllerScroll.signals.scroll_end(event_controller_scroll)¶
- Signal Name:
scroll-end
- Flags:
- Parameters:
event_controller_scroll (
Gtk.EventControllerScroll
) – The object which received the signal
Signals that a new scrolling operation has finished. It will only be emitted on devices capable of it.
Property Details¶
- Gtk.EventControllerScroll.props.flags¶
- Name:
flags
- Type:
- Default Value:
- Flags:
The flags affecting event controller behavior
New in version 3.24.