Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using ipywidgets #12

Open
amaurydar opened this issue Jun 6, 2018 · 3 comments
Open

using ipywidgets #12

amaurydar opened this issue Jun 6, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@amaurydar
Copy link

Most of the things I tried with ipywidgets work well, but here I don't understand what's wrong.

/%python
import ipywidgets as widgets
from IPython.display import display

out = widgets.Output()
def foo(x):
    with out:
        print(x)

b = widgets.Button(description='Button')
b.on_click(foo)

display(b)
display(out)

When calling foo('bar') directly it works well : 'bar' is printed in the Output widget.
When pressing the button it doesn't.

Doing exactly the same thing with a python kernel works.

@jhanna-kx
Copy link
Collaborator

Hi,
Could you let me know what the expected output is here when you push the button? With the latest version of jupyterq I see the same behaviour on clicking the button as with a python 3 kernel.

JupyterQ kernel after 2 button clicks
q_kernel

Python kernel after 2 button clicks.
python_kernel

Do you see something different with a python kernel?

@amaurydar
Copy link
Author

amaurydar commented Jun 7, 2018

The expected output is what you see.
In fact I just realized that it does work in jupyter notebook, but it doesn't work in jupyter lab.

So to sum up :
jupyter notebook + python kernel -> something is printed when button pressed
jupyter notebook + q kernel -> something is printed when button pressed
jupyter lab + python kernel -> something is printed when button pressed
jupyter lab + q kernel -> nothing happens when button pressed

@jhanna-kx jhanna-kx added the enhancement New feature or request label Jun 12, 2018
@jhanna-kx
Copy link
Collaborator

Yes, widgets are a bit experimental and we've not done any testing with jupyterlab really as it's only in beta (moved from alpha this year I believe). Will look at adding support for widgets in jupyterlab in a future release, if you've any ideas as to what might be needed to support jupyterlab do post them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants