Swipe gesture on a scrolled window

Hi, I would like to implement a vertical swipe gesture in a ScrolledWindow using gtkmm 4.
Specifically: I want vertical swipe gestures to cause vertical scrolling.
I created a ScrolledWindow and added a ListBox child.
I also created a GestureSwipe with PropagationPhase::BUBBLE, and registered to signal_swipe.
What do I need to to on this event? There’s no ScrolledWindow::scroll() method.
An example will be highly appreciated :slight_smile:
Thx in advance

The horizontal and vertical position of a GtkScrolledWindow is controlled by a GtkAdjustment. You can change the value property on the vertical adjustment.

THX! I want to create a smooth continuous movement, but the GestureSwipe [signal_swipe] (gtkmm: Gtk::GestureSwipe Class Reference) is emitted at the end of the swipe gesture. I’m trying to use the signal_update signal but I can’t find how to get the movement delta from the EventSequence* param. How can I obtain it?

I think you would have to store and calculate the deltas yourself from the x/y position, but I’m not sure.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.