When the following code is run in JupyterLab 0.32.1 with ipywidgets 7.3.1 and @jupyter-widgets/jupyterlab-manager 0.36.1, nothing happens when the button is clicked. The word "Test" should be printed. It works in the classic Notebook.
from IPython.display import display
from ipywidgets import widgets
def test(b):
print('Test')
button = widgets.Button(description='Test')
button.on_click(test)
display(button)
Hi @scottdotjs, I believe you have to use an OutputWidget. Jupyter Notebook had a hack that allowed output to be displayed from a widget directly. cc @jasongrout, the Widget Events tutorial should be updated to use an output widget.
@blink1073 Perfect! Thanks very much.
See https://github.com/jupyter-widgets/ipywidgets/issues/2148 for an example.
Most helpful comment
Hi @scottdotjs, I believe you have to use an OutputWidget. Jupyter Notebook had a hack that allowed output to be displayed from a widget directly. cc @jasongrout, the Widget Events tutorial should be updated to use an output widget.