Hi Texus,
Sorry to ask another question. I'm having a situation with the scroll-bars, where I only want the scrollbar to appear when the content expands to a size that is outside of the panel. So this means, I'm updating the maximum as the content grows. However if I then call the setMaximum, the callback function gets called as I assume the trigger of tgui::ScrollBar::ValueChanged gets hit when I update the maximum.
so one idea I had was prior to changing the maximum, was to unbind the function callback, change the maximum and then rebind it again. Question is how do I get the callback function details? i.e. as per the below pseudo code. I temporarily stored the original scrollbar prior to changes. I unbind and change the maximum. How can I get the the bind function from the original scrollbar so that I can re-set it? (BTW getScrollbar just retrieves the scrollbar ptr from a std::vector based on widget name.
Sorry to ask another question. I'm having a situation with the scroll-bars, where I only want the scrollbar to appear when the content expands to a size that is outside of the panel. So this means, I'm updating the maximum as the content grows. However if I then call the setMaximum, the callback function gets called as I assume the trigger of tgui::ScrollBar::ValueChanged gets hit when I update the maximum.
so one idea I had was prior to changing the maximum, was to unbind the function callback, change the maximum and then rebind it again. Question is how do I get the callback function details? i.e. as per the below pseudo code. I temporarily stored the original scrollbar prior to changes. I unbind and change the maximum. How can I get the the bind function from the original scrollbar so that I can re-set it? (BTW getScrollbar just retrieves the scrollbar ptr from a std::vector based on widget name.
Code (cpp) Select
if (IsScollBarAlreadyInList(scrollbarName))
{
tgui::Scrollbar origScrollbar = *getScrollbar(scrollbarName);
getScrollbar(scrollbarName)->unbindAllCallback();
getScrollbar(scrollbarName)->setMaximum(passed_MaxAmount);
}