Possible to add custom model without an icon in the toolbar?

Is it possible to add a custom model such as this: A new custom tool — Bokeh 2.4.2 Documentation without showing it in the toolbar as an icon (i still want to show other icons such as pan and zoom etc.)

If yes - can i then activate/deactivate the tool programtically such that i can actually create my own button etc. to activate/deactivate the tool?

AFAIK any custom model that subclasses Tool will always show up in the toolbar. You can supply your own icon, but it will display in the toolbar.

The currently active tools are functions of any individual tools. Bokeh has to prevent, e.g. two scroll tools from being active at the same time, since they would conflict with one another. The active tools are specified, per-gesture, on the Toolbar, via properties active_drag, active_scroll, etc:

Hi @Bryan thanks for the reply… ok i see. I know it’s possible to hide the toolbar, so could a solution then be to just totally hide the toolbar and make my own toolbar basically - which enables tools programmatically according to whatever logic i define (as long as i respect that certain tools cannot be active at the same time)?

Yes you can set the active_<gesture> properties on the Toolbar even if it is hidden.

awesome, thanks