Scroll-bar's current value

The scroll-bar's callback gets executed whenever the scroll-bar's value changes. This is the preferred way to obtain its current value. scrollbar.C installs a callback that puts the new scroll-bar value into the input-field above it.

uint32_t v=sb->get_value();

uint32_t v=sb->get_dragged_value();

get_value() and get_dragged_value() poll the scroll-bar's current values and return them. The values can change at any time, a callback is the more reliably way to keep tabs on it. set() explicitly sets the scroll-bar's new value. scrollbar.C uses this to update the scroll-bar when it's decimal points setting changes. The shown logical value gets updated in the example's input field by the scroll-bar's callback. set() updates the scroll-bar, which causes its callback to get executed, to report the scroll-bar's new value.