You shouldn’t have to do the click detection and all that, the widget should do that for you. You just need to make some method that takes in a float, and then pass that into the OnUserScrolled as a delegate (function pointer).
Let’s assume all this code is in some object called MyObject. Then, if I wanted to add a callback for when the user scrolls, you’d do something like:
// Where you are setting up the scroll bar widget.
TSharedRef<SScrollBar> MyScrollBar = SNew(SScrollBar).OnUserScrolled(this, &MyObject::MyOnUserScrolledCallback);
// Define the method
void MyObject::MyOnUserScrolledCallback(float scrollValue)
{
// scrollValue is a value between 0 - 1. Figure out where that ratio lies in comparison to your data set and repopulate your widget those items.
}
Just multiply the ratio value (e.g. 0 - 1) times your total items, so scrollValue * MaxItems = Your new offset for data. The post you linked doesn’t matter in this case. A standard float should have enough precision, even if your max number of items is huge (which will cause memory and other issues ) - it should still be fine.