quicksettings
quicksettings copied to clipboard
.addButton runs callback on load
apologies in advance -- it's not clear to me whether this is a bug or simply my own user error:
I'm dynamically created quicksettings GUIs when a new JS object is made. When I use addButton(), the callback runs when the button is created. Significantly, the button is supposed to delete the object and the GUI -- so you can see my predicament. Is there a way to disable this, or something special with quicksettings?
my work around is the following:
let done = false;
gui.addButton("delete", deleteObj());
done = true;
function deleteObj(){
if (done){
gui.remove();
}
}