Gtk.EventControllerScroll¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gtk.EventController (5), GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(widget, flags) | 
| get_flags() | |
| set_flags(flags) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Inherited: | Gtk.EventController (2) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| flags | Gtk.EventControllerScrollFlags | r/w/en | Flags | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| decelerate | Emitted after scroll is finished if the Gtk.EventControllerScrollFlags.KINETICflag is set. | 
| scroll | Signals that the widget should scroll by the amount specified by dx and dy. | 
| scroll-begin | Signals that a new scrolling operation has begun. | 
| scroll-end | Signals that a new scrolling operation has finished. | 
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Gtk.EventControllerScroll(**kwargs)¶
- Bases: - Gtk.EventController- Abstract: - No - Structure: - Gtk.EventControllerScrollClass- Gtk.EventControllerScrollis 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- Gtk.EventControllerScroll- ::scrollsignal (deltas in the discrete case are multiples of 1).- In the case of continuous scroll events, - Gtk.EventControllerScrollencloses all- Gtk.EventControllerScroll- ::scrollevents between two- Gtk.EventControllerScroll- ::scroll-beginand- Gtk.EventControllerScroll- ::scroll-endsignals.- 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.HORIZONTALand #GTK_EVENT_CONTROLLER_SCROLL_BOTH. If any axis is disabled, the respective- Gtk.EventControllerScroll- ::scrolldelta 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.KINETICflag toggles the emission of the- Gtk.EventControllerScroll- ::deceleratesignal, 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. 
- widget (
 - 
get_flags()[source]¶
- Returns: - the controller flags. - Return type: - Gtk.EventControllerScrollFlags- 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. 
 
- 
classmethod 
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 signal
- vel_x (float) – X velocity
- vel_y (float) – Y velocity
 - Emitted after scroll is finished if the - Gtk.EventControllerScrollFlags.KINETICflag 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.
- event_controller_scroll (
- 
Gtk.EventControllerScroll.signals.scroll(event_controller_scroll, dx, dy)¶
- Signal Name: - scroll- Flags: - Parameters: - event_controller_scroll (Gtk.EventControllerScroll) – The object which received the signal
- dx (float) – X delta
- dy (float) – Y delta
 - Signals that the widget should scroll by the amount specified by dx and dy. 
- event_controller_scroll (
- 
Gtk.EventControllerScroll.signals.scroll_begin(event_controller_scroll)¶
- Signal Name: - scroll-begin- Flags: - RUN_FIRST- 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: - RUN_FIRST- 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: - Gtk.EventControllerScrollFlags- Default Value: - Gtk.EventControllerScrollFlags.NONE- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The flags affecting event controller behavior - New in version 3.24.