Hello,
Yes it is possible. To see how it works in real life : have a look at the morpheur synth I uploaded few days ago.
Example thereafter shows how it works.
<Cabbage>
form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginID("def1")
groupbox bounds(80,10,200,150) visible(1) identchannel("GBox") {
label bounds(20,20,100,18) text("Hide me")
}
image bounds(80,10,200,150) visible(0) identchannel("Image")
button bounds(5,20,60,40) channel("button") latched(1) text("hide","show")
keyboard bounds(8, 200, 381, 95)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
instr 2
if changed:k(chnget:k("button"))==1 then
if chnget:k("button")==1 then
chnset "visible(0)","GBox"
else
chnset "visible(1)","GBox"
endif
endif
endin
;instrument will be triggered by keyboard widget
instr 1
kEnv madsr .1, .2, .6, .4
aOut vco2 p5, p4
outs aOut*kEnv, aOut*kEnv
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
i 2 0 z
</CsScore>
</CsoundSynthesizer>