I'm experimenting with Jupyter Widgets to see if I can make a better version of this, but apparently the observe handler triggers even when the change is not from the user, so it creates an infinite loop of one widget changing the other. Minimal example:
import ipywidgets as widgets
a = widgets.FloatText(description='a:')
b = widgets.FloatText(description='b:')
def on_a_change(change):
b.value = change['new'] + 1
a.observe(on_a_change, names='value')
def on_b_change(change):
a.value = change['new'] + 1
b.observe(on_b_change, names='value')
display(a)
display(b)
Is there any way to only trigger on a user-initiated change? In other words, the user updates one text box, and then the others are updated from it, but those updates don't trigger more updates.