What is the proper way to remove a led$ object from screen. If I invoke a led$, how do i remove it? Do I have to redraw the whole page, or do I have to place another led on top with the same color as background? I just want the led visible under certain conditions (as a visual warning)
The code below is how I draw an led, but what code would remove it?
The only way I could define my own On and Off LED colours when I was doing the Alerts Monitor project (a long time ago) was to create my own LED's.
Therefore I was initially interested with the later ability to define the text colour of LED$ component, but I couldn't find a way to still use them as bi-state LEDs any more. It's only possible to define one colour anyway (the specified string$ colour name) so it is not possible to define On and Off colours... and presumably it cannot still be a bi-colour LED anyway if has been defined as a colour string$ variable, thereby preventing it being defined as a changeable bi-state numeric variable. Nor can the original component colour be re-defined with a different string$ colour, because that would create an additional new component of the new colour name.
You could create a new colour$ LED to overwrite the original location, but creating a new html object would cause screen flicker, and it would need to be done every time it needs to change colour.
Maybe it is now easier to change the named colour LED's actual colour by 'styling' it to something different.
Or perhaps you could just hack out the relevant lines (3) from the Alerts Monitor to create your own LEDs with your chosen On and Off colours, which you would change using CSS cssid$ (in place of the old TRACE syntax) without flicker … and if you assign your page background colour to a variable name, you could also use it to specify the LED Off colour.
As you can imagine, there are many ways to achieve this, but perhaps the simplest is to enclose the LED $ object in a <div> with a unique ID and change its visibility property.
Luck!