Change icon appearence based on a variable

I have these commands that switch some variables on and off in order to draw special things. I would like to have an icon in my custom toolbar for that switch.

Is there a way to tell the CUI to read a variable in Bricscad in order to set the correct .ico image for the toolbar command button? Say a Green icon if the switch is On or a Red one if the switch is Off.
Or maybe i could switch something like the .ico path programatically when the switch is activated?
Could i switch the .ico path in real time and refresh the CUI?

Thanks.

Comments