Fl_Scroll: Add possibility to get notified when scroll position changes?
Jakub HolĂ˝
Sep 09, 2022
Hello, awesome FLTK devs!
I find myself needing to get notified and run custom code when scrolling is happening / stops. Currently there seems no way to achieve that. Perhaps it would be generally useful if Fl_Scroll had callback(s) triggered when its x/yposition changes.
Background: I am making a file explorer for pictures, displaying thumbnails. For performance reasons I only show thumbnails of pictures in the visible viewport. When the user scrolls to a new position (or is scrolling slowly), I want to load and show also these newly visible pictures' thumbnails. Thus I want to trigger the image loading function when scrolling ends.
Obviously FLTK lived fine without this for many years and I was able to implement this by querying the scroll's yposition every 100ms, so it might not be worth the effort. But it would be nice.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.