Gtk.GestureSwipe¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.GestureSingle (8), Gtk.Gesture (17), Gtk.EventController (13), GObject.Object (37)
- Structs:
class |
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Gtk.GestureSingle (3), Gtk.Gesture (1), Gtk.EventController (4)
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the recognized gesture is finished. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.GestureSwipe(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkGestureSwipe
is aGtkGesture
for swipe gestures.After a press/move/…/move/release sequence happens, the [signal`Gtk`.GestureSwipe::swipe] signal will be emitted, providing the velocity and directionality of the sequence at the time it was lifted.
If the velocity is desired in intermediate points, [method`Gtk`.GestureSwipe.get_velocity] can be called in a [signal`Gtk`.Gesture::update] handler.
All velocities are reported in pixels/sec units.
- classmethod new()[source]¶
- Returns:
a newly created
GtkGestureSwipe
- Return type:
Returns a newly created
GtkGesture
that recognizes swipes.
- get_velocity()[source]¶
- Returns:
whether velocity could be calculated
- velocity_x:
return value for the velocity in the X axis, in pixels/sec
- velocity_y:
return value for the velocity in the Y axis, in pixels/sec
- Return type:
Gets the current velocity.
If the gesture is recognized, this function returns
True
and fills in velocity_x and velocity_y with the recorded velocity, as per the last events processed.
Signal Details¶
- Gtk.GestureSwipe.signals.swipe(gesture_swipe, velocity_x, velocity_y)¶
- Signal Name:
swipe
- Flags:
- Parameters:
gesture_swipe (
Gtk.GestureSwipe
) – The object which received the signalvelocity_x (
float
) – velocity in the X axis, in pixels/secvelocity_y (
float
) – velocity in the Y axis, in pixels/sec
Emitted when the recognized gesture is finished.
Velocity and direction are a product of previously recorded events.