Gtk.GestureSwipe


Gtk.GestureSwipe — Swipe gesture

Object Hierarchy:

    GObject
    ╰── Gtk.EventController
        ╰── Gtk.Gesture
            ╰── Gtk.GestureSingle
                ╰── Gtk.GestureSwipe

Functions:

  • new (widget:Gtk.Widget) -> Gtk.Gesture
  • get_velocity (self) -> bool, velocity_x:float, velocity_y:float

Signals:

  • “swipe” (gesture, velocity_x, velocity_y, user_data)

Description:

Gtk.GestureSwipe is a GtkGesture implementation able to recognize swipes, after a press/move/.../move/release sequence happens, the and directionality of the sequence at the time it was lifted.

If the velocity is desired in intermediate points, Gtk.GestureSwipe::get_velocity() can be called on eg. a All velocities are reported in pixels/sec units.


Function Details:

new()

new (widget:Gtk.Widget) -> Gtk.Gesture

Returns a newly created Gtk.Gesture that recognizes swipes.

  • Returns: a newly created Gtk.GestureSwipe

  • Since: 3.14


get_velocity()

get_velocity (self) -> bool, velocity_x:float, velocity_y:float

If the gesture is recognized, this function returns True and fill invelocity_x and velocity_y with the recorded velocity, as per thelast event(s) processed.

  • Returns: whether velocity could be calculated

  • Since: 3.14


results matching ""

    No results matching ""