:right-sidebar: True EventControllerScroll =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: EventControllerScroll(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` :Constructors: :: EventControllerScroll(**properties) new(flags:Gtk.EventControllerScrollFlags) -> Gtk.EventController Constructors ------------ .. rst-class:: interim-class .. class:: EventControllerScroll :no-index: .. classmethod:: new(flags: ~gi.repository.Gtk.EventControllerScrollFlags) -> ~gi.repository.Gtk.EventController Creates a new event controller that will handle scroll events. :param flags: flags affecting the controller behavior Methods ------- .. rst-class:: interim-class .. class:: EventControllerScroll :no-index: .. method:: get_flags() -> ~gi.repository.Gtk.EventControllerScrollFlags Gets the flags conditioning the scroll controller behavior. .. method:: get_unit() -> ~gi.repository.Gdk.ScrollUnit Gets the scroll unit of the last :obj:`~gi.repository.Gtk.EventControllerScroll.signals.scroll` signal received. Always returns ``%GDK_SCROLL_UNIT_WHEEL`` if the :const:`~gi.repository.Gtk.EventControllerScrollFlags.DISCRETE` flag is set. .. versionadded:: 4.8 .. method:: set_flags(flags: ~gi.repository.Gtk.EventControllerScrollFlags) -> None Sets the flags conditioning scroll controller behavior. :param flags: flags affecting the controller behavior Properties ---------- .. rst-class:: interim-class .. class:: EventControllerScroll :no-index: .. attribute:: props.flags :type: ~gi.repository.Gtk.EventControllerScrollFlags The flags affecting event controller behavior. Signals ------- .. rst-class:: interim-class .. class:: EventControllerScroll.signals :no-index: .. method:: decelerate(vel_x: float, vel_y: float) -> None Emitted after scroll is finished if the :const:`~gi.repository.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. :param vel_x: X velocity :param vel_y: Y velocity .. method:: scroll(dx: float, dy: float) -> bool Signals that the widget should scroll by the amount specified by ``dx`` and ``dy``. For the representation unit of the deltas, see :obj:`~gi.repository.Gtk.EventControllerScroll.get_unit`. :param dx: X delta :param dy: Y delta .. method:: scroll_begin() -> None Signals that a new scrolling operation has begun. It will only be emitted on devices capable of it. .. method:: scroll_end() -> None Signals that a scrolling operation has finished. It will only be emitted on devices capable of it.