Associating a progress bar with a spinner.
The spinners values go from 0-100
The progress bar will fill 100% of the spinner is 100 and 0% of 0.
That is simple enough.
My question is how to make the color of the bar go from red to green. Red = 0 and Green = 100
By
Comments (3)
Comment policy
Or( colStart = red as
Or
Got It.
rollout rlProgBar "Bar" width:114
(
spinner spnSelectAmount pos:[1,4] fieldwidth:96 range:[0,100,0] type:#float
progressBar pbProgress "" pos:[4,22] width:106 height:15 value:spnSelectAmount.value color:[0,0,0]
on spnSelectAmount changed val do
(
print "Change"
prog = spnSelectAmount.value
pbProgress.value = prog
pbProgress.color.r = (255-((255/100)*prog))
pbProgress.color.g = ((255/100)*prog)
pbProgress.color.b = 0
)
)
createDialog rlProgBar
Wow! Good solution :)