@David-Healey I think the OP has one panel and 4 buttons in different places, and each button needs to show/hide the panel.
Like a global Settings panel that can be opened by a button in the main UI, or a button on the Effects page, or a button on the Arpeggiator page.
@Yannrog is this what you're trying to do? If so, something like this will work:
const pnlSettings = Content.getComponent("pnlSettings");
const btnSettings = Content.getAllComponents("btnSettings");
for (b in btnSettings) b.setControlCallback(btnSettingsControl);
inline function btnSettingsControl(component, value) {
if (value) {
for (b in btnSettings) {
if (b != component) b.setValue(0);
}
}
pnlSettings.showControl(value);
}
Your buttons can be btnSettingsMain, btnSettingsEffects, etc.
Or, simpler: btnSettings1, btnSettings2, etc. as long as they all start with btnSettings
Same code, but fully commented, in case it helps:
# Find the panel you want to show/hide
const pnlSettings = Content.getComponent("pnlSettings");
# Find all the buttons that need to toggle the panel:
# btnSettingsMain, btnSettingsEffects, etc.
const btnSettings = Content.getAllComponents("btnSettings");
# Set the function that is called when any of the buttons are clicked
for (b in btnSettings) b.setControlCallback(btnSettingsControl);
# The function that shows/hides the panel when a button is clicked
inline function btnSettingsControl(component, value) {
# If the button is clicked 'on', turn off all the other buttons
if (value) {
# Check every button in btnSettings
for (b in btnSettings) {
# If it's a different button, turn it off
if (b != component) b.setValue(0);
}
}
# Set the panel visibility to the value of the button:
# Button on gives value of 1, which shows the panel
# Button off gives value of 0, which hides the panel
pnlSettings.showControl(value);
}
CleanShot 2026-05-13 at 22.43.38.gif