A ToolbarButton can be instantiated like this:
new ToolbarButton({
className: 'the-name-of-the-class',
onClick: ()=>{},
icon: a-lab-icon-object
});
Is there a supported way to toggle the icon image?
I’m guessing that the method used in order to toggle the kernel status is supported, so I was able to use this method: jupyterlab/widget.tsx at e4e323992d24f6c5e48d181381e23c547b665b15 · jupyterlab/jupyterlab · GitHub
However, that isn’t using a ToolbarButton.
I know I can toggle the class of a ToolbarButton’s Widget in order to toggle its background image, which gets covered up by the button’s background. However, I’m interested in learning if there is a supported way to toggle the icon in order for the person who is looking at it to be able to see it when it changes.