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

jupyter widgets seem to be one-way. What if an attribute is changed elsewhere? Can it be dynamically change in the widget? #3

Open
jgeisz opened this issue Feb 4, 2022 · 3 comments

Comments

@jgeisz
Copy link
Collaborator

jgeisz commented Feb 4, 2022

No description provided.

@jbuencuerpo
Copy link
Collaborator

So basically you are saying, update the value in other part of the code, and then update the ui right?
I think it can be done by accesing the .value of the widget[1]. But I am not sure what you are trying, do you have a simple code to look at?

[1] https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Low%20Level.html

@jgeisz
Copy link
Collaborator Author

jgeisz commented Mar 7, 2022

dynamic widget update can be problem because of recursion.

  • set() methods change the class attributes
  • new update() methods update widget values, but this must be called explicitly after using set() to change.

@jgeisz
Copy link
Collaborator Author

jgeisz commented Mar 10, 2022

yes, change the widget.value in the .update() methods. This is a good enough solution. The user just needs to know and remember to use it when changing the values outside of the ui.

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

No branches or pull requests

2 participants