Correction to the slider widget

20 views
Skip to first unread message

Bruce Sherwood

unread,
Sep 12, 2016, 6:11:58 PM9/12/16
to Glowscript Users
There was a serious bug in the new slider object, which is now fixed in GlowScript 2.1. A slider value can be changed either by the user of the program moving the slider or by the program setting the slider (s.value = something). In the latter case, the "bind" function should NOT be called, because that function may wish to change the positions of other sliders, and those changes shouldn't call their own "bind" functions in what could be an infinite loop of actions. Here is the updated Help description of the slider value attribute (the RGB-HSV demo program is now much simpler than it was):

value The current value (between min and max) of the slider. Can be set by program as well as by user motions. When you set the value by program (slider.value = something), the bind function is NOT executed, which prevents confusion that would arise in situations such as the RGB-HSV demo program, where a user change in a slider causes program changes to the values of other sliders.

Reply all
Reply to author
Forward
0 new messages