Quote:
Originally Posted by Lokasenna
Setting it to a function will show whatever is returned by calling my_function(value). For instance, to make the knob show "dB" next to every number you would use:
Code:
local function append_db(value)
return value .. "dB"
end
GUI.elms.my_knob.output = append_db
|
OK, it seems that the knob can not run a function directly, it can only send some value out. So is the slider?
If I want a knob to adjust item's volume, I need to define a function that get the value from knob using GUI.Val("myknob"), then give it to item via SetMediaItemSelected, and then run the function in defer mode. I tried before and it worked. But I do not know if there any better way to code it. Please let me know, THANKS!
UPDATE: I just realized that I can use "onmousedown" and "onmousedrag" to do that, thats amazing! Thanks again!!