I am creating a widget with a spinbox. On the event construct event I am loading the value for the Spinbox, which works fine:
The next step is to write to the variable (same as the loading variable) when the user is changing the value of the SpinBox either with the slider or when the value is committed over the text box.
I am trying to use the available events of the SpinBox “On Value Changed” and/or “On Value Committed”. However when I run my code and the widget is opening, the value of the SpinBox is always 0.
I solved it using a Boolean that is set to true as default and changed to false when the “Event construct” and all values are loaded. In the functions that act on the “On value changed” event I added a branch and the value is only changed when the Boolean is false. Ofc when I am leaving the widget, I set the Boolean to true again so it works when the user opens the widget multiple times. In that way I present that the value is set to 0. Below you can see the blueprints:
Boolean “Widget Opening” is set to false at the end of the “Event construct” event.