@p-himik
Thanks for your reply!
I modified the code like you said (if I understood correctly) but now the button is disabled but the next_tick function isn’t being invoked.
from bokeh.models.widgets.buttons import Button
from time import sleep
from bokeh.io import curdoc
# button
button = Button(
label="Test",
button_type='primary',
name="button"
)
# callback
def on_button_click():
button.disabled=True
def next_tick():
sleep(2)
button.disabled=False
button.on_click(on_button_click)
curdoc().add_root(button)
curdoc().add_next_tick_callback(next_tick)