Help with iteration
-
As the console warning message says, const var declarations must be on global level. So it can't be in a function or loop.
Also
push
is a good way to create such arrays.const var arry_DotBox = []; for (i = 0; i < 16; i++) { arry_DotBox.push(Content.getComponent("DotBox" + i)); arry_DotBox[i].setLocalLookAndFeel(dotBoxLaf); }
-
@d-healey said in Help with iteration:
What's a dot box?
A "DotBox" is just a modification of your checkbox.
I prefer the dots for button matrices: -
@VirtualVirgin for that use case it's better to use a panel rather than an array of buttons. Using a panel is also dynamic so you can change the number of dot boxes on the fly
-
@VirtualVirgin You might want to check this out
https://forum.hise.audio/topic/7049/my-tooth-hurts?_=1731938031853
But I don't guarantee the snippet will load because it's quite old...
-
This post is deleted! -
This post is deleted! -
@d-healey said in Help with iteration:
@VirtualVirgin for that use case it's better to use a panel rather than an array of buttons. Using a panel is also dynamic so you can change the number of dot boxes on the fly
In the example above the buttons are already on a panel.
Are you saying I should use a panel instead of buttons?
I can get multiple values from different places on a panel? -
@VirtualVirgin said in Help with iteration:
Are you saying I should use a panel instead of buttons?
Yes. Take a look at this (1:45:44)
-
This post is deleted! -
@VirtualVirgin Sorry about the multiples! I kept getting a "bad gateway error" when trying to post and it didn't look like they went through.
-
@VirtualVirgin just delete them then.