We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello! I want to show some widget in a callback event, code is run ok in notebook but not show on voila.
support? or how to show widgets in callback func?
import ipywidgets as widgets slider = widgets.FloatSlider(description="$x$", value=4) text = widgets.FloatText(disabled=True, description="$x^2$") def compute(*ignore): text.value = str(slider.value ** 2) slider.observe(compute, "value") def check_support(*ignore): test_text = widgets.Text() # not showing display(test_text) text.value = 0.1 check_btn = widgets.Button(description="check_support") display(check_btn) check_btn.on_click(check_support) widgets.VBox([slider, text])
The text was updated successfully, but these errors were encountered:
@xdyuchen and using the Output widget?
Output
So the code above becomes:
import ipywidgets as widgets slider = widgets.FloatSlider(description="$x$", value=4) text = widgets.FloatText(disabled=True, description="$x^2$") out = widgets.Output() def compute(*ignore): text.value = str(slider.value ** 2) slider.observe(compute, "value") @out.capture() def check_support(*ignore): test_text = widgets.Text() # not showing display(test_text) text.value = "0.1" check_btn = widgets.Button(description="check_support") display(check_btn) check_btn.on_click(check_support) display(widgets.VBox([slider, text])) out
Sorry, something went wrong.
No branches or pull requests
Hello!
I want to show some widget in a callback event, code is run ok in notebook but not show on voila.
support? or how to show widgets in callback func?
The text was updated successfully, but these errors were encountered: