i am having issues with a slider
i am using the event slider value changed
when i set the slider value in the widget with the mouse, its value changes to the correct value and i capture and use it in my function related to the event
but then its value immediately goes to zero again - it again triggers the value changed event and in the function its value is recorder (get) as zero
why would this be
it is not the first slider i am using but the first time this is occurring
How are you doing it - with the slider’s delegate?
but then its value immediately goes to zero again
When? Under regular circumstances, it would not. Any more details?
it again triggers the value changed
It sounds a bit like the script created a dependency loop, where we read a value off a slider, set process and its value and have the slider report back. At least, that’s what I got from the description.
As a rule of thumb, it’s not advised to query widgets directly for their data but rely on the built-in delegates (or wrap widgets and build your own). You may need to demonstrate the actual script / result.
it is an ordinary / plain slider on a “bigger” widget
and i am debugging / have breakpoints because obviously something is not going as planned
on the event graph i have the slider value change event and a function running from it
i have a breakpoint on the function
i check the slider value inside the function with a breakpoint
1st run it is fine
but then the event function that is referred to above and intended for the slider value change gets triggered again and the next / new slider value inside the function is zero
at first i thought it was bounce, but no
then i thought it was related to the slider max value, but i no longer think so
at this point i deleted the sliders and created new ones because i think i might have copied them from anothe widget
it works as intended when i use the slider on mouse capture lost event to get the slider value change rather than the slider value change event
still need to figure out why the slider value change would fire twice - it must be firing twice to trigger the slider value change function one more once
and i dont know why it would fire with the right value the first time and then fire with zero the second time