I am trying to make VBox widget and and add a new row with text when button is clicked.
I try the following code
import ipywidgets as wg
from ipywidgets import Layout
from IPython.display import display
vb = wg.VBox([wg.Text('1'),wg.Text('2')])
btn = wg.Button(description = 'Add')
def on_bttn_clicked(b):
vb.children=tuple(list(vb.children).append(wg.Text('3')))
btn.on_click(on_bttn_clicked)
display(vb, btn)
list(hb.children)
But the assignment "hb.children=" does not work... Is there a way to edit container widgets with code in the same cell?