Default button state on load
-
@dannytaurus
That's how I always do it. -
@Oli-Ullmann Cools, cheers

-
@dannytaurus said in Default button state on load:
Do I have to script the 'on' value in onInit,
Is the button set to saveInPreset?
-
@David-Healey No, it's for a show/hide tooltips panel.
I suppose I should be saving the value somewhere so it survives across plugin loads.
Are there any docs/examples for saving user preferences?EDIT: found an example: https://docs.hise.dev/tutorials/scripting/index.html#user-preference-system
-
@dannytaurus You could also invert your logic so
!valueactually means the panel is showing -
@ustk
That's a cool idea! -
@ustk Could do, but I prefer to keep the button's 'on' state synced to the panel's visible state.
If I start flipping values as a workaround, my future self will not thank me when he looks at the code in 2 years!

-
Another option is to have the panel and the button watch each other's states using broadcasters.
-

-
-
@David-Healey
far worse than all I imagined 
