How to implement kinetic scrolling with `Gtk.EventControllerScroll`?`

I’m creating a notification center that shows a list of notifications. Each notification widget consists of a main bodyGtk.Button that contains some children Gtk.Buttons (like a close button). Now the main button should’ve a different action from the close button. But due to being a child button the close button always activates the main Gtk.Button’s action. I can stop that by setting propagation_limit = False in the main Gtk.Button. But now when I put the list inside a Gtk.ScrolledWindow it doesn’t scroll due to the propagation limit. Gtk.ScrolledWindow also doesn’t expose any Gtk.EventControllerScroll.

I found a workaround by using Gtk.EventControllerScroll instead of Gtk.ScrolledWindow but couldn’t find any example implementing kinetic scrolling. It’ll be helpful if I get some logic examples.

Hi,

hmm, sounds troublesome…
why not using a Gtk.ListBoxRow instead, inside a Gtk.ListBox ?

Or implement a custom widget that handles the Gtk.GestureClick::released signal?

1 Like

Using Gtk.ListBoxRow with a Gio.Action solved the issue. Thanks!

1 Like

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