HISE
HISE copied to clipboard
Add ComboBox.clear() API.
Not sure if I'm doing this completely correctly (as I couldn't find this resulting method in auto-generated API docs within the HISE interface) but here's a .clear
method on ScriptComboBox
.
Why is this useful? I found myself in a situation where I dynamically added elements to a ComboBox
from within a script, but found that HISE would continue appending elements every time I compiled the script, resulting in a hard-coded list of hundreds of elements. With .clear()
, scripts can now ensure that they're starting with a completely blank slate before populating a ComboBox.
You can also just call ComboBox.set("items", "");
in Javascript which clears the list too, but I agree a method like this is convenient.